Sha256: 6cd4d1485f1c7bfb3e654988b4e5b294e3fabd274df0a4f580b1069c4404f738

Contents?: true

Size: 1.43 KB

Versions: 52

Compression:

Stored size: 1.43 KB

Contents

describe :time_local, :shared => true do

  ruby_version_is ""..."1.9" do
    it "creates a time based on given values, interpreted in the local time zone" do
      with_timezone("PST", -8) do
        Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "Sat Jan 01 20:15:01 -0800 2000"
      end
    end

    it "creates a time based on given C-style gmtime arguments, interpreted in the local time zone" do
      with_timezone("PST", -8) do
        time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
        time.inspect.should == "Sat Jan 01 20:15:01 -0800 2000"
      end
    end

    it "respects rare old timezones" do
      with_timezone("Europe/Amsterdam") do
        time = Time.send(@method, 1910, 1, 1)
        time.to_i.should == -1893457172
        time.inspect.should == "Sat Jan 01 00:00:00 +0019 1910"
      end
    end
  end

  ruby_version_is "1.9" do
    it "creates a time based on given values, interpreted in the local time zone" do
      with_timezone("PST", -8) do
        Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "2000-01-01 20:15:01 -0800"
      end
    end

    it "creates a time based on given C-style gmtime arguments, interpreted in the local time zone" do
      with_timezone("PST", -8) do
        time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
        time.inspect.should == "2000-01-01 20:15:01 -0800"
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-7.5.1 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-7.4.1 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-7.1.17 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-6.2.0 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-6.0.11 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.18 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.17 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.15 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.2 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-5.5.0 spec/framework_spec/app/spec/core/time/shared/local.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/core/time/shared/local.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/core/time/shared/local.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-3.3.5 spec/framework_spec/app/spec/core/time/shared/local.rb
rhodes-3.4.2 spec/framework_spec/app/spec/core/time/shared/local.rb