aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/core/fixnum/size_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/fixnum/size_spec.rb')
-rw-r--r--spec/rubyspec/core/fixnum/size_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/rubyspec/core/fixnum/size_spec.rb b/spec/rubyspec/core/fixnum/size_spec.rb
new file mode 100644
index 0000000000..f973d446ed
--- /dev/null
+++ b/spec/rubyspec/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