summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time/_dump_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/time/_dump_spec.rb')
-rw-r--r--spec/ruby/core/time/_dump_spec.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/ruby/core/time/_dump_spec.rb b/spec/ruby/core/time/_dump_spec.rb
index bec16dab69..21f0806327 100644
--- a/spec/ruby/core/time/_dump_spec.rb
+++ b/spec/ruby/core/time/_dump_spec.rb
@@ -1,5 +1,5 @@
-# -*- encoding: binary -*-
-require File.expand_path('../../../spec_helper', __FILE__)
+# encoding: binary
+require_relative '../../spec_helper'
describe "Time#_dump" do
before :each do
@@ -10,22 +10,22 @@ describe "Time#_dump" do
end
it "is a private method" do
- Time.should have_private_instance_method(:_dump, false)
+ Time.private_instance_methods(false).should.include?(:_dump)
end
# http://redmine.ruby-lang.org/issues/show/627
it "preserves the GMT flag" do
- @t.gmt?.should == true
+ @t.should.gmt?
dump = @t.send(:_dump).unpack("VV").first
((dump >> 30) & 0x1).should == 1
- @local.gmt?.should == false
+ @local.should_not.gmt?
dump = @local.send(:_dump).unpack("VV").first
((dump >> 30) & 0x1).should == 0
end
it "dumps a Time object to a bytestring" do
- @s.should be_an_instance_of(String)
+ @s.should.instance_of?(String)
@s.should == [3222863947, 2235564032].pack("VV")
end
@@ -53,4 +53,3 @@ describe "Time#_dump" do
t.send(:_dump).should == "\364\001\031\200\313\000\020\004"
end
end
-