diff options
Diffstat (limited to 'spec/ruby/library/zlib/crc32_spec.rb')
| -rw-r--r-- | spec/ruby/library/zlib/crc32_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/ruby/library/zlib/crc32_spec.rb b/spec/ruby/library/zlib/crc32_spec.rb index 22d1dac28b..b94b5c627c 100644 --- a/spec/ruby/library/zlib/crc32_spec.rb +++ b/spec/ruby/library/zlib/crc32_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' require 'zlib' describe "Zlib.crc32" do @@ -24,10 +24,12 @@ describe "Zlib.crc32" do Zlib.crc32(test_string, 1).should == 1809313411 Zlib.crc32(test_string, 2**8).should == 1722745982 Zlib.crc32(test_string, 2**16).should == 1932511220 - lambda { Zlib.crc32(test_string, 2**128) }.should raise_error(RangeError) + Zlib.crc32("p", ~305419896).should == 4046865307 + Zlib.crc32("p", -305419897).should == 4046865307 + -> { Zlib.crc32(test_string, 2**128) }.should.raise(RangeError) end - it "calculates the CRC checksum for string and initial CRC value for Bignums" do + it "calculates the CRC checksum for string and initial CRC value for Integers" do test_string = "This is a test string! How exciting!%?" # Zlib.crc32(test_string, -2**30).should == 277228695 Zlib.crc32(test_string, 2**30).should == 46597132 |
