Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid "should_not raise_error" and add test cases for completeness

  • Loading branch information...
commit 933fce1130ab414d8ede04c2944bee6d41d96e1d 1 parent 8a14357
@BanzaiMan BanzaiMan authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 language/hash_spec.rb
View
13 language/hash_spec.rb
@@ -51,11 +51,14 @@
h.should == {:a => 1, :b => 2}
end
- it "recognizes {:a==>1} as a valid expression" do
- lambda {
- h = {:a==>1}
- h[:a=].should == 1
- }.should_not raise_error
+ it "recognizes '=' at the end of the key" do
+ eval("{:a==>1}").should == {:"a=" => 1}
+ eval("{:a= =>1}").should == {:"a=" => 1}
+ eval("{:a= => 1}").should == {:"a=" => 1}
+ end
+
+ it "with '==>' in the middle raises SyntaxError" do
+ lambda {eval("{:a ==> 1}")}.should raise_error(SyntaxError)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.