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-3.0.4 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.3 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.2 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.12.3 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.12.2 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.12.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.12.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.11.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.11.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.10.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.9.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.8.2 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.8.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.8.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.7.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.7.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.6.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-2.5.0 spec/ios/nsstring_timezone_spec.rb