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.5.8 spec/nsstring_timezone_spec.rb
sugarcube-1.5.7 spec/nsstring_timezone_spec.rb
sugarcube-1.5.6 spec/nsstring_timezone_spec.rb
sugarcube-1.5.5 spec/nsstring_timezone_spec.rb
sugarcube-1.5.4 spec/nsstring_timezone_spec.rb
sugarcube-1.5.3 spec/nsstring_timezone_spec.rb
sugarcube-1.5.2 spec/nsstring_timezone_spec.rb
sugarcube-1.5.1 spec/nsstring_timezone_spec.rb
sugarcube-1.5.0 spec/nsstring_timezone_spec.rb
sugarcube-1.4.6 spec/nsstring_timezone_spec.rb
sugarcube-1.4.5 spec/nsstring_timezone_spec.rb
sugarcube-1.4.4 spec/nsstring_timezone_spec.rb
sugarcube-1.4.3 spec/nsstring_timezone_spec.rb
sugarcube-1.4.2 spec/nsstring_timezone_spec.rb
sugarcube-1.4.1 spec/nsstring_timezone_spec.rb
sugarcube-1.4.0 spec/nsstring_timezone_spec.rb
sugarcube-1.3.11 spec/nsstring_timezone_spec.rb
sugarcube-1.3.10 spec/nsstring_timezone_spec.rb
sugarcube-1.3.9 spec/nsstring_timezone_spec.rb
sugarcube-1.3.8 spec/nsstring_timezone_spec.rb