Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ccfc8d8d8615
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1cca55485db9
Choose a head ref
  • 5 commits
  • 143 files changed
  • 1 contributor

Commits on Feb 16, 2017

  1. Capitalized exception messages throughout the codebase

    Sija authored and Ary Borenszweig committed Feb 16, 2017
    Copy the full SHA
    2548214 View commit details
  2. Fix specs related to changed exception messages

    Sija authored and Ary Borenszweig committed Feb 16, 2017
    Copy the full SHA
    47dc2a6 View commit details
  3. Remove obsolete error message check

    Sija authored and Ary Borenszweig committed Feb 16, 2017
    Copy the full SHA
    18b3fd6 View commit details
  4. Make “Bug” prefix uppercased to improve visibility

    Sija authored and Ary Borenszweig committed Feb 16, 2017
    Copy the full SHA
    5b508b6 View commit details
  5. Cleanup a bit expanded macro rescue block

    Sija authored and Ary Borenszweig committed Feb 16, 2017
    Copy the full SHA
    1cca554 View commit details
Showing with 522 additions and 515 deletions.
  1. +4 −4 spec/compiler/normalize/select_spec.cr
  2. +4 −4 spec/spec_helper.cr
  3. +13 −13 spec/std/array_spec.cr
  4. +1 −1 spec/std/big/big_int_spec.cr
  5. +2 −2 spec/std/char_spec.cr
  6. +3 −3 spec/std/colorize_spec.cr
  7. +3 −3 spec/std/csv/csv_lex_spec.cr
  8. +3 −3 spec/std/csv/csv_parse_spec.cr
  9. +2 −2 spec/std/csv/csv_spec.cr
  10. +2 −2 spec/std/deque_spec.cr
  11. +1 −1 spec/std/dir_spec.cr
  12. +1 −1 spec/std/enumerable_spec.cr
  13. +13 −13 spec/std/file_spec.cr
  14. +1 −1 spec/std/file_utils_spec.cr
  15. +1 −1 spec/std/flate/flate_spec.cr
  16. +2 −2 spec/std/http/client/client_spec.cr
  17. +1 −1 spec/std/int_spec.cr
  18. +1 −1 spec/std/io/buffered_spec.cr
  19. +1 −1 spec/std/io/delimited_spec.cr
  20. +11 −11 spec/std/io/io_spec.cr
  21. +19 −19 spec/std/io/memory_spec.cr
  22. +1 −1 spec/std/io/multi_writer_spec.cr
  23. +2 −2 spec/std/io/sized_spec.cr
  24. +1 −1 spec/std/iterator_spec.cr
  25. +5 −5 spec/std/json/builder_spec.cr
  26. +2 −2 spec/std/json/mapping_spec.cr
  27. +2 −2 spec/std/json/parser_spec.cr
  28. +3 −3 spec/std/json/pull_parser_spec.cr
  29. +4 −4 spec/std/pointer_spec.cr
  30. +5 −5 spec/std/random_spec.cr
  31. +3 −3 spec/std/socket_spec.cr
  32. +2 −2 spec/std/spec_spec.cr
  33. +20 −20 spec/std/string_spec.cr
  34. +1 −1 spec/std/time/time_spec.cr
  35. +2 −2 spec/std/yaml/mapping_spec.cr
  36. +1 −1 spec/std/zlib/reader_spec.cr
  37. +1 −1 spec/std/zlib/writer_spec.cr
  38. +15 −15 src/array.cr
  39. +2 −2 src/big/big_int.cr
  40. +1 −1 src/char.cr
  41. +3 −3 src/colorize.cr
  42. +4 −4 src/compiler/crystal/codegen/call.cr
  43. +3 −3 src/compiler/crystal/codegen/cast.cr
  44. +7 −7 src/compiler/crystal/codegen/codegen.cr
  45. +1 −1 src/compiler/crystal/codegen/debug.cr
  46. +1 −1 src/compiler/crystal/codegen/fun.cr
  47. +2 −2 src/compiler/crystal/codegen/llvm_id.cr
  48. +2 −2 src/compiler/crystal/codegen/llvm_typer.cr
  49. +12 −12 src/compiler/crystal/codegen/primitives.cr
  50. +9 −1 src/compiler/crystal/macros/macros.cr
  51. +3 −3 src/compiler/crystal/semantic/bindings.cr
  52. +3 −3 src/compiler/crystal/semantic/call.cr
  53. +2 −2 src/compiler/crystal/semantic/conversions.cr
  54. +2 −2 src/compiler/crystal/semantic/literal_expander.cr
  55. +9 −9 src/compiler/crystal/semantic/main_visitor.cr
  56. +3 −3 src/compiler/crystal/semantic/restrictions.cr
  57. +1 −1 src/compiler/crystal/semantic/type_lookup.cr
  58. +1 −1 src/compiler/crystal/syntax/ast.cr
  59. +12 −12 src/compiler/crystal/syntax/parser.cr
  60. +5 −5 src/compiler/crystal/tools/formatter.cr
  61. +13 −13 src/compiler/crystal/types.cr
  62. +1 −1 src/concurrent.cr
  63. +1 −1 src/concurrent/future.cr
  64. +4 −4 src/csv.cr
  65. +2 −2 src/csv/lexer.cr
  66. +1 −1 src/csv/lexer/io_based.cr
  67. +1 −1 src/csv/lexer/string_based.cr
  68. +1 −1 src/debug/elf.cr
  69. +5 −5 src/deque.cr
  70. +4 −4 src/ecr/lexer.cr
  71. +4 −4 src/enumerable.cr
  72. +1 −1 src/event/signal_handler.cr
  73. +7 −7 src/file.cr
  74. +2 −2 src/file/preader.cr
  75. +2 −2 src/file_utils.cr
  76. +1 −1 src/flate/reader.cr
  77. +2 −2 src/flate/writer.cr
  78. +1 −1 src/gzip/header.cr
  79. +1 −1 src/gzip/reader.cr
  80. +1 −1 src/gzip/writer.cr
  81. +4 −5 src/http/client.cr
  82. +3 −3 src/http/client/response.cr
  83. +1 −1 src/http/headers.cr
  84. +1 −1 src/http/params.cr
  85. +3 −3 src/http/server/response.cr
  86. +1 −1 src/http/web_socket.cr
  87. +1 −1 src/http/web_socket/protocol.cr
  88. +5 −5 src/iconv.cr
  89. +2 −2 src/int.cr
  90. +4 −4 src/io.cr
  91. +1 −1 src/io/argf.cr
  92. +1 −1 src/io/encoding.cr
  93. +1 −1 src/io/error.cr
  94. +2 −2 src/io/file_descriptor.cr
  95. +7 −7 src/io/memory.cr
  96. +1 −1 src/io/sized.cr
  97. +3 −3 src/iterator.cr
  98. +6 −6 src/json/any.cr
  99. +11 −11 src/json/builder.cr
  100. +3 −3 src/json/from_json.cr
  101. +5 −5 src/json/lexer.cr
  102. +1 −1 src/json/lexer/string_based.cr
  103. +2 −2 src/json/mapping.cr
  104. +1 −1 src/json/parser.cr
  105. +4 −4 src/json/pull_parser.cr
  106. +2 −2 src/llvm/function.cr
  107. +1 −1 src/llvm/function_collection.cr
  108. +1 −1 src/llvm/jit_compiler.cr
  109. +5 −5 src/llvm/type.cr
  110. +1 −1 src/macros.cr
  111. +1 −1 src/number.cr
  112. +1 −1 src/oauth2/access_token/mac.cr
  113. +2 −2 src/object.cr
  114. +2 −2 src/openssl/cipher.cr
  115. +5 −5 src/pointer.cr
  116. +1 −1 src/process.cr
  117. +6 −6 src/random.cr
  118. +4 −4 src/readline.cr
  119. +1 −1 src/reference.cr
  120. +1 −1 src/secure_random.cr
  121. +2 −2 src/semantic_version.cr
  122. +1 −1 src/slice.cr
  123. +1 −1 src/socket.cr
  124. +4 −4 src/socket/address.cr
  125. +22 −22 src/spec/expectations.cr
  126. +21 −21 src/string.cr
  127. +2 −2 src/string/builder.cr
  128. +8 −8 src/string/formatter.cr
  129. +6 −6 src/time.cr
  130. +13 −13 src/time/format/parser.cr
  131. +2 −2 src/xml/builder.cr
  132. +1 −1 src/xml/node.cr
  133. +2 −2 src/xml/xpath_context.cr
  134. +6 −6 src/yaml/any.cr
  135. +1 −1 src/yaml/builder.cr
  136. +3 −3 src/yaml/from_yaml.cr
  137. +2 −2 src/yaml/mapping.cr
  138. +2 −2 src/zip/checksum_reader.cr
  139. +1 −1 src/zip/checksum_writer.cr
  140. +5 −5 src/zip/file.cr
  141. +2 −2 src/zip/reader.cr
  142. +4 −4 src/zlib/reader.cr
  143. +1 −1 src/zlib/writer.cr
8 changes: 4 additions & 4 deletions spec/compiler/normalize/select_spec.cr
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ describe "Normalize: case" do
when 1
baz
else
::raise("Bug: invalid select index")
::raise("BUG: invalid select index")
end
CODE
end
@@ -23,7 +23,7 @@ describe "Normalize: case" do
x = __temp_2.as(typeof(foo))
x + 1
else
::raise("Bug: invalid select index")
::raise("BUG: invalid select index")
end
CODE
end
@@ -48,7 +48,7 @@ describe "Normalize: case" do
x = __temp_2.as(typeof(foo?))
x + 1
else
::raise("Bug: invalid select index")
::raise("BUG: invalid select index")
end
CODE
end
@@ -61,7 +61,7 @@ describe "Normalize: case" do
x = __temp_2.as(typeof(foo!))
x + 1
else
::raise("Bug: invalid select index")
::raise("BUG: invalid select index")
end
CODE
end
8 changes: 4 additions & 4 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -219,21 +219,21 @@ def assert_syntax_error(str, message = nil, line = nil, column = nil, metafile =
it "says syntax error on #{str.inspect}", metafile, metaline, metaendline do
begin
parse str
fail "expected SyntaxException to be raised", metafile, metaline
fail "Expected SyntaxException to be raised", metafile, metaline
rescue ex : SyntaxException
if message
unless ex.message.not_nil!.includes?(message.not_nil!)
fail "expected message to include #{message.inspect} but got #{ex.message.inspect}", metafile, metaline
fail "Expected message to include #{message.inspect} but got #{ex.message.inspect}", metafile, metaline
end
end
if line
unless ex.line_number == line
fail "expected line number to be #{line} but got #{ex.line_number}", metafile, metaline
fail "Expected line number to be #{line} but got #{ex.line_number}", metafile, metaline
end
end
if column
unless ex.column_number == column
fail "expected column number to be #{column} but got #{ex.column_number}", metafile, metaline
fail "Expected column number to be #{column} but got #{ex.column_number}", metafile, metaline
end
end
end
26 changes: 13 additions & 13 deletions spec/std/array_spec.cr
Original file line number Diff line number Diff line change
@@ -26,13 +26,13 @@ describe "Array" do
end

it "raises on negative count" do
expect_raises(ArgumentError, "negative array size") do
expect_raises(ArgumentError, "Negative array size") do
Array.new(-1, 3)
end
end

it "raises on negative capacity" do
expect_raises(ArgumentError, "negative array size") do
expect_raises(ArgumentError, "Negative array size") do
Array(Int32).new(-1)
end
end
@@ -176,13 +176,13 @@ describe "Array" do
end

it "raises on negative count" do
expect_raises ArgumentError, /negative count: -1/ do
expect_raises ArgumentError, /Negative count: -1/ do
[1, 2, 3][1, -1]
end
end

it "raises on negative count on empty Array" do
expect_raises ArgumentError, /negative count: -1/ do
expect_raises ArgumentError, /Negative count: -1/ do
Array(Int32).new[0, -1]
end
end
@@ -260,7 +260,7 @@ describe "Array" do
a[1, 3] = 6
a.should eq([1, 6, 5, 6, 7, 8])

expect_raises ArgumentError, "negative count" do
expect_raises ArgumentError, "Negative count" do
[1, 2, 3][0, -1]
end

@@ -1471,7 +1471,7 @@ describe "Array" do
it { [1, 2, 3].permutations(3).should eq([[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]) }
it { [1, 2, 3].permutations(0).should eq([[] of Int32]) }
it { [1, 2, 3].permutations(4).should eq([] of Array(Int32)) }
it { expect_raises(ArgumentError, "size must be positive") { [1].permutations(-1) } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].permutations(-1) } }

it "accepts a block" do
sums = [] of Int32
@@ -1502,7 +1502,7 @@ describe "Array" do
object_ids.size.should eq(1)
end

it { expect_raises(ArgumentError, "size must be positive") { [1].each_permutation(-1) { } } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].each_permutation(-1) { } } }

it "returns iterator" do
a = [1, 2, 3]
@@ -1555,7 +1555,7 @@ describe "Array" do
it { [1, 2, 3].combinations(4).should eq([] of Array(Int32)) }
it { [1, 2, 3, 4].combinations(3).should eq([[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]) }
it { [1, 2, 3, 4].combinations(2).should eq([[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]) }
it { expect_raises(ArgumentError, "size must be positive") { [1].combinations(-1) } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].combinations(-1) } }

it "accepts a block" do
sums = [] of Int32
@@ -1595,7 +1595,7 @@ describe "Array" do
sums.should eq([3, 4, 5])
end

it { expect_raises(ArgumentError, "size must be positive") { [1].each_combination(-1) { } } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].each_combination(-1) { } } }

it "returns iterator" do
a = [1, 2, 3, 4]
@@ -1646,7 +1646,7 @@ describe "Array" do
it { [1, 2, 3].repeated_combinations(3).should eq([[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 2], [1, 2, 3], [1, 3, 3], [2, 2, 2], [2, 2, 3], [2, 3, 3], [3, 3, 3]]) }
it { [1, 2, 3].repeated_combinations(0).should eq([[] of Int32]) }
it { [1, 2, 3].repeated_combinations(4).should eq([[1, 1, 1, 1], [1, 1, 1, 2], [1, 1, 1, 3], [1, 1, 2, 2], [1, 1, 2, 3], [1, 1, 3, 3], [1, 2, 2, 2], [1, 2, 2, 3], [1, 2, 3, 3], [1, 3, 3, 3], [2, 2, 2, 2], [2, 2, 2, 3], [2, 2, 3, 3], [2, 3, 3, 3], [3, 3, 3, 3]]) }
it { expect_raises(ArgumentError, "size must be positive") { [1].repeated_combinations(-1) } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].repeated_combinations(-1) } }

it "accepts a block" do
sums = [] of Int32
@@ -1665,7 +1665,7 @@ describe "Array" do
sums.should eq([6, 7, 8, 8, 9, 10, 9, 10, 11, 12])
end

it { expect_raises(ArgumentError, "size must be positive") { [1].each_repeated_combination(-1) { } } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].each_repeated_combination(-1) { } } }

it "yields with reuse = true" do
sums = [] of Int32
@@ -1739,7 +1739,7 @@ describe "Array" do
it { [1, 2, 3].repeated_permutations(3).should eq([[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 1], [1, 2, 2], [1, 2, 3], [1, 3, 1], [1, 3, 2], [1, 3, 3], [2, 1, 1], [2, 1, 2], [2, 1, 3], [2, 2, 1], [2, 2, 2], [2, 2, 3], [2, 3, 1], [2, 3, 2], [2, 3, 3], [3, 1, 1], [3, 1, 2], [3, 1, 3], [3, 2, 1], [3, 2, 2], [3, 2, 3], [3, 3, 1], [3, 3, 2], [3, 3, 3]]) }
it { [1, 2, 3].repeated_permutations(0).should eq([[] of Int32]) }
it { [1, 2, 3].repeated_permutations(4).should eq([[1, 1, 1, 1], [1, 1, 1, 2], [1, 1, 1, 3], [1, 1, 2, 1], [1, 1, 2, 2], [1, 1, 2, 3], [1, 1, 3, 1], [1, 1, 3, 2], [1, 1, 3, 3], [1, 2, 1, 1], [1, 2, 1, 2], [1, 2, 1, 3], [1, 2, 2, 1], [1, 2, 2, 2], [1, 2, 2, 3], [1, 2, 3, 1], [1, 2, 3, 2], [1, 2, 3, 3], [1, 3, 1, 1], [1, 3, 1, 2], [1, 3, 1, 3], [1, 3, 2, 1], [1, 3, 2, 2], [1, 3, 2, 3], [1, 3, 3, 1], [1, 3, 3, 2], [1, 3, 3, 3], [2, 1, 1, 1], [2, 1, 1, 2], [2, 1, 1, 3], [2, 1, 2, 1], [2, 1, 2, 2], [2, 1, 2, 3], [2, 1, 3, 1], [2, 1, 3, 2], [2, 1, 3, 3], [2, 2, 1, 1], [2, 2, 1, 2], [2, 2, 1, 3], [2, 2, 2, 1], [2, 2, 2, 2], [2, 2, 2, 3], [2, 2, 3, 1], [2, 2, 3, 2], [2, 2, 3, 3], [2, 3, 1, 1], [2, 3, 1, 2], [2, 3, 1, 3], [2, 3, 2, 1], [2, 3, 2, 2], [2, 3, 2, 3], [2, 3, 3, 1], [2, 3, 3, 2], [2, 3, 3, 3], [3, 1, 1, 1], [3, 1, 1, 2], [3, 1, 1, 3], [3, 1, 2, 1], [3, 1, 2, 2], [3, 1, 2, 3], [3, 1, 3, 1], [3, 1, 3, 2], [3, 1, 3, 3], [3, 2, 1, 1], [3, 2, 1, 2], [3, 2, 1, 3], [3, 2, 2, 1], [3, 2, 2, 2], [3, 2, 2, 3], [3, 2, 3, 1], [3, 2, 3, 2], [3, 2, 3, 3], [3, 3, 1, 1], [3, 3, 1, 2], [3, 3, 1, 3], [3, 3, 2, 1], [3, 3, 2, 2], [3, 3, 2, 3], [3, 3, 3, 1], [3, 3, 3, 2], [3, 3, 3, 3]]) }
it { expect_raises(ArgumentError, "size must be positive") { [1].repeated_permutations(-1) } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].repeated_permutations(-1) } }

it "accepts a block" do
sums = [] of Int32
@@ -1781,7 +1781,7 @@ describe "Array" do
sums.should eq([6, 7, 8, 7, 8, 9, 8, 9, 10, 7, 8, 9, 8, 9, 10, 9, 10, 11, 8, 9, 10, 9, 10, 11, 10, 11, 12])
end

it { expect_raises(ArgumentError, "size must be positive") { [1].each_repeated_permutation(-1) { } } }
it { expect_raises(ArgumentError, "Size must be positive") { [1].each_repeated_permutation(-1) { } } }
end

describe "Array.each_product" do
2 changes: 1 addition & 1 deletion spec/std/big/big_int_spec.cr
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ describe "BigInt" do
end

it "raises if creates from string but invalid" do
expect_raises ArgumentError, "invalid BigInt: 123 hello 456" do
expect_raises ArgumentError, "Invalid BigInt: 123 hello 456" do
BigInt.new("123 hello 456")
end
end
4 changes: 2 additions & 2 deletions spec/std/char_spec.cr
Original file line number Diff line number Diff line change
@@ -212,13 +212,13 @@ describe "Char" do
end

it "to_i rejects unsupported base (1)" do
expect_raises ArgumentError, "invalid base 1" do
expect_raises ArgumentError, "Invalid base 1" do
'0'.to_i(1)
end
end

it "to_i rejects unsupported base (37)" do
expect_raises ArgumentError, "invalid base 37" do
expect_raises ArgumentError, "Invalid base 37" do
'0'.to_i(37)
end
end
6 changes: 3 additions & 3 deletions spec/std/colorize_spec.cr
Original file line number Diff line number Diff line change
@@ -76,19 +76,19 @@ describe "colorize" do
end

it "raises on unknown foreground color" do
expect_raises ArgumentError, "unknown color: brown" do
expect_raises ArgumentError, "Unknown color: brown" do
"hello".colorize(:brown)
end
end

it "raises on unknown background color" do
expect_raises ArgumentError, "unknown color: brown" do
expect_raises ArgumentError, "Unknown color: brown" do
"hello".colorize.back(:brown)
end
end

it "raises on unknown mode" do
expect_raises ArgumentError, "unknown mode: bad" do
expect_raises ArgumentError, "Unknown mode: bad" do
"hello".colorize.mode(:bad)
end
end
6 changes: 3 additions & 3 deletions spec/std/csv/csv_lex_spec.cr
Original file line number Diff line number Diff line change
@@ -122,21 +122,21 @@ describe CSV do
end

it "raises if single quote in the middle" do
expect_raises CSV::MalformedCSVError, "unexpected quote at 1:4" do
expect_raises CSV::MalformedCSVError, "Unexpected quote at 1:4" do
lexer = CSV::Lexer.new %(hel"lo)
lexer.next_token
end
end

it "raises if command, newline or end doesn't follow quote" do
expect_raises CSV::MalformedCSVError, "expecting comma, newline or end, not 'a' at 1:6" do
expect_raises CSV::MalformedCSVError, "Expecting comma, newline or end, not 'a' at 1:6" do
lexer = CSV::Lexer.new %("hel"a)
lexer.next_token
end
end

it "raises on unclosed quote" do
expect_raises CSV::MalformedCSVError, "unclosed quote at 1:5" do
expect_raises CSV::MalformedCSVError, "Unclosed quote at 1:5" do
lexer = CSV::Lexer.new %("foo)
lexer.next_token
end
6 changes: 3 additions & 3 deletions spec/std/csv/csv_parse_spec.cr
Original file line number Diff line number Diff line change
@@ -50,19 +50,19 @@ describe CSV do
end

it "raises if single quote in the middle" do
expect_raises CSV::MalformedCSVError, "unexpected quote at 1:4" do
expect_raises CSV::MalformedCSVError, "Unexpected quote at 1:4" do
CSV.parse(%(hel"lo))
end
end

it "raises if command, newline or end doesn't follow quote" do
expect_raises CSV::MalformedCSVError, "expecting comma, newline or end, not 'a' at 2:6" do
expect_raises CSV::MalformedCSVError, "Expecting comma, newline or end, not 'a' at 2:6" do
CSV.parse(%(foo\n"hel"a))
end
end

it "raises if command, newline or end doesn't follow quote (2)" do
expect_raises CSV::MalformedCSVError, "expecting comma, newline or end, not 'a' at 2:6" do
expect_raises CSV::MalformedCSVError, "Expecting comma, newline or end, not 'a' at 2:6" do
CSV.parse(%(\n"hel"a))
end
end
4 changes: 2 additions & 2 deletions spec/std/csv/csv_spec.cr
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ describe CSV do

it "raises if trying to access before first row" do
csv = new_csv headers: true
expect_raises(CSV::Error, "before first row") do
expect_raises(CSV::Error, "Before first row") do
csv["one"]
end
end
@@ -43,7 +43,7 @@ describe CSV do

csv.next.should be_false

expect_raises(CSV::Error, "after last row") do
expect_raises(CSV::Error, "After last row") do
csv["one"]
end
end
4 changes: 2 additions & 2 deletions spec/std/deque_spec.cr
Original file line number Diff line number Diff line change
@@ -112,13 +112,13 @@ describe "Deque" do
end

it "raises on negative count" do
expect_raises(ArgumentError, "negative deque size") do
expect_raises(ArgumentError, "Negative deque size") do
Deque.new(-1, 3)
end
end

it "raises on negative capacity" do
expect_raises(ArgumentError, "negative deque capacity") do
expect_raises(ArgumentError, "Negative deque capacity") do
Deque(Int32).new(-1)
end
end
2 changes: 1 addition & 1 deletion spec/std/dir_spec.cr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ end

private def it_raises_on_null_byte(operation, &block)
it "errors on #{operation}" do
expect_raises(ArgumentError, "string contains null byte") do
expect_raises(ArgumentError, "String contains null byte") do
block.call
end
end
2 changes: 1 addition & 1 deletion spec/std/enumerable_spec.cr
Original file line number Diff line number Diff line change
@@ -472,7 +472,7 @@ describe "Enumerable" do
it { [1, 2, 3].in_groups_of(2, "x").should eq([[1, 2], [3, "x"]]) }

it "raises argument error if size is less than 0" do
expect_raises ArgumentError, "size must be positive" do
expect_raises ArgumentError, "Size must be positive" do
[1, 2, 3].in_groups_of(0)
end
end
26 changes: 13 additions & 13 deletions spec/std/file_spec.cr
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ end

private def it_raises_on_null_byte(operation, &block)
it "errors on #{operation}" do
expect_raises(ArgumentError, "string contains null byte") do
expect_raises(ArgumentError, "String contains null byte") do
block.call
end
end
@@ -623,7 +623,7 @@ describe "File" do
it "raises if invoking seek with a closed file" do
file = File.new("#{__DIR__}/data/test_file.txt")
file.close
expect_raises(IO::Error, "closed stream") { file.seek(1) }
expect_raises(IO::Error, "Closed stream") { file.seek(1) }
end

it "returns the current read position with tell" do
@@ -646,7 +646,7 @@ describe "File" do
it "raises if invoking tell with a closed file" do
file = File.new("#{__DIR__}/data/test_file.txt")
file.close
expect_raises(IO::Error, "closed stream") { file.tell }
expect_raises(IO::Error, "Closed stream") { file.tell }
end

it "iterates with each_char" do
@@ -766,15 +766,15 @@ describe "File" do

begin
File.open(filename) do |io|
expect_raises(ArgumentError, "negative bytesize") do
expect_raises(ArgumentError, "Negative bytesize") do
io.read_at(3, -1) { }
end

expect_raises(ArgumentError, "offset out of bounds") do
expect_raises(ArgumentError, "Offset out of bounds") do
io.read_at(12, 1) { }
end

expect_raises(ArgumentError, "bytesize out of bounds") do
expect_raises(ArgumentError, "Bytesize out of bounds") do
io.read_at(6, 6) { }
end
end
@@ -935,13 +935,13 @@ describe "File" do
io = File.open(__FILE__, "r")
io.close

expect_raises(IO::Error, "closed stream") { io.gets_to_end }
expect_raises(IO::Error, "closed stream") { io.print "hi" }
expect_raises(IO::Error, "closed stream") { io.puts "hi" }
expect_raises(IO::Error, "closed stream") { io.seek(1) }
expect_raises(IO::Error, "closed stream") { io.gets }
expect_raises(IO::Error, "closed stream") { io.read_byte }
expect_raises(IO::Error, "closed stream") { io.write_byte('a'.ord.to_u8) }
expect_raises(IO::Error, "Closed stream") { io.gets_to_end }
expect_raises(IO::Error, "Closed stream") { io.print "hi" }
expect_raises(IO::Error, "Closed stream") { io.puts "hi" }
expect_raises(IO::Error, "Closed stream") { io.seek(1) }
expect_raises(IO::Error, "Closed stream") { io.gets }
expect_raises(IO::Error, "Closed stream") { io.read_byte }
expect_raises(IO::Error, "Closed stream") { io.write_byte('a'.ord.to_u8) }
end
end

2 changes: 1 addition & 1 deletion spec/std/file_utils_spec.cr
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ describe "FileUtils" do
end

it "raises an error if the directory doesn't exists" do
expect_raises(ArgumentError, "no such directory : not_existing_dir") do
expect_raises(ArgumentError, "No such directory : not_existing_dir") do
FileUtils.cp({File.join(__DIR__, "data/test_file.text")}, "not_existing_dir")
end
end
Loading