diff options
Diffstat (limited to 'spec/ruby/core/fixnum/size_spec.rb')
-rw-r--r-- | spec/ruby/core/fixnum/size_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/ruby/core/fixnum/size_spec.rb b/spec/ruby/core/fixnum/size_spec.rb new file mode 100644 index 0000000000..f973d446ed --- /dev/null +++ b/spec/ruby/core/fixnum/size_spec.rb @@ -0,0 +1,19 @@ +require File.expand_path('../../../spec_helper', __FILE__) + +describe "Fixnum#size" do + platform_is wordsize: 32 do + it "returns the number of bytes in the machine representation of self" do + -1.size.should == 4 + 0.size.should == 4 + 4091.size.should == 4 + end + end + + platform_is wordsize: 64 do + it "returns the number of bytes in the machine representation of self" do + -1.size.should == 8 + 0.size.should == 8 + 4091.size.should == 8 + end + end +end |