Skip to content

Commit

Permalink
Add tests for Range#to_s Range#inspect.
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed May 8, 2014
1 parent c071ad1 commit 60d2b51
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/t/range.rb
Expand Up @@ -74,6 +74,20 @@
assert_false a.member?(20)
end

assert('Range#to_s', '15.2.14.4.12') do
assert_equal "0..1", (0..1).to_s
assert_equal "0...1", (0...1).to_s
assert_equal "a..b", ("a".."b").to_s
assert_equal "a...b", ("a"..."b").to_s
end

assert('Range#inspect', '15.2.14.4.13') do
assert_equal "0..1", (0..1).inspect
assert_equal "0...1", (0...1).inspect
assert_equal "\"a\"..\"b\"", ("a".."b").inspect
assert_equal "\"a\"...\"b\"", ("a"..."b").inspect
end

assert('Range#eql?', '15.2.14.4.14') do
assert_true (1..10).eql? (1..10)
assert_false (1..10).eql? (1..100)
Expand Down

0 comments on commit 60d2b51

Please sign in to comment.