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-4.0.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.5.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.4.2 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.4.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.4.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.7 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.6 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.5 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.4 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.3 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.2 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.3.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.2.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.1.1 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.1.0 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.8 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.7 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.6 spec/ios/nsstring_timezone_spec.rb
sugarcube-3.0.5 spec/ios/nsstring_timezone_spec.rb