Sha256: baf7b9a490019df43588a766abad775e66f9880250b91f4aeec13375d2334c57

Contents?: true

Size: 720 Bytes

Versions: 98

Compression:

Stored size: 720 Bytes

Contents

describe "NSString to NSTimeZone" do

  it "should parse timezone as UTC" do
    "UTC".nstimezone.secondsFromGMT.should == 0
  end

  it "should parse timezone as Asia/Tokyo" do
    "Asia/Tokyo".nstimezone.secondsFromGMT.should == 9 * 60 * 60
  end

  it "should parse timezone as Asia/Tokyo" do
    "UTC+9".nstimezone.secondsFromGMT.should == 9 * 60 * 60
  end

  it "should parse timezone as Asia/Tokyo" do
    "GMT+9".nstimezone.secondsFromGMT.should == 9 * 60 * 60
  end

  it "should parse timezone as Asia/Tokyo" do
    "+0900".nstimezone.secondsFromGMT.should == 9 * 60 * 60
  end

  it "should parse timezone integer as Asia/Tokyo" do
    (9 * 60 * 60).nstimezone.secondsFromGMT.should == 9 * 60 * 60
  end

end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
sugarcube-1.3.7 spec/nsstring_timezone_spec.rb
sugarcube-1.3.6 spec/nsstring_timezone_spec.rb
sugarcube-1.3.5 spec/nsstring_timezone_spec.rb
sugarcube-1.3.4 spec/nsstring_timezone_spec.rb
sugarcube-1.3.3 spec/nsstring_timezone_spec.rb
sugarcube-1.3.2 spec/nsstring_timezone_spec.rb
sugarcube-1.3.1 spec/nsstring_timezone_spec.rb
sugarcube-1.3.0 spec/nsstring_timezone_spec.rb
sugarcube-1.1.0 spec/nsstring_timezone_spec.rb
sugarcube-1.0.7 spec/nsstring_timezone_spec.rb
sugarcube-1.0.6 spec/nsstring_timezone_spec.rb
sugarcube-1.0.5 spec/nsstring_timezone_spec.rb
sugarcube-1.0.4 spec/nsstring_timezone_spec.rb
sugarcube-1.0.3 spec/nsstring_timezone_spec.rb
sugarcube-1.0.2 spec/nsstring_timezone_spec.rb
sugarcube-1.0.1 spec/nsstring_timezone_spec.rb
sugarcube-1.0.0 spec/nsstring_timezone_spec.rb
sugarcube-0.20.25 spec/nsstring_timezone_spec.rb