Skip to content

Commit

Permalink
Add specs for Fixnum bitwise operators and Floats
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink authored and brixen committed Oct 15, 2011
1 parent 37c0ed5 commit e6cd391
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/fixnum/bit_and_spec.rb
Expand Up @@ -33,6 +33,12 @@
end
end

ruby_version_is "1.9" do
it "raises a TypeError when passed a Float" do
lambda { (3 & 3.4) }.should raise_error(TypeError)
end
end

ruby_version_is ""..."1.9.4" do
it "calls #to_int to convert an object to an Integer" do
obj = mock("fixnum bit and")
Expand Down
6 changes: 6 additions & 0 deletions core/fixnum/bit_or_spec.rb
Expand Up @@ -35,6 +35,12 @@
end
end

ruby_version_is "1.9" do
it "raises a TypeError when passed a Float" do
lambda { (3 | 3.4) }.should raise_error(TypeError)
end
end

ruby_version_is ""..."1.9.4" do
it "calls #to_int to convert an object to an Integer" do
obj = mock("fixnum bit or")
Expand Down
6 changes: 6 additions & 0 deletions core/fixnum/bit_xor_spec.rb
Expand Up @@ -33,6 +33,12 @@
end
end

ruby_version_is "1.9" do
it "raises a TypeError when passed a Float" do
lambda { (3 ^ 3.4) }.should raise_error(TypeError)
end
end

ruby_version_is ""..."1.9.4" do
it "calls #to_int to convert an object to an Integer" do
obj = mock("fixnum bit xor")
Expand Down

0 comments on commit e6cd391

Please sign in to comment.