HomePhorge

(maint) Expect test to fail on windows ruby 2.0 x86
9050bc1a087aUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(maint) Expect test to fail on windows ruby 2.0 x86

Ruby 2.0 x86 on windows does not observe the 'TZ' environment variable, so the
test would generate a Time object whose #zone was 'Eur', but had timezone
offset based on the current timezone.

C:\work\puppet>ruby --version
ruby 2.0.0p481 (2014-05-08) [i386-mingw32]
C:\work\puppet>irb
irb(main):001:0> ENV['TZ'] = 'Europe/London'
=> "Europe/London"
irb(main):002:0> tm = Time.local(2012, "dec", 11, 15, 59, 2)
=> 2012-12-11 15:59:02 -0800
irb(main):003:0> tm.zone
=> "Eur"
irb(main):004:0> tm.gmt_offset
=> -28800

Ironically, ruby 1.9 and 2.0 x64 do the correct thing:

C:\Windows\system32>ruby --version
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
C:\Windows\system32>irb
irb(main):001:0> ENV['TZ'] = 'Europe/London'
=> "Europe/London"
irb(main):002:0> tm = Time.local(2012, "dec", 11, 15, 59, 2)
=> 2012-12-11 15:59:02 +0000
irb(main):003:0> tm.gmt_offset
=> 0
irb(main):004:0> tm.zone
=> "Eur"

This commit modifies the test so that we expect failure on windows 1.8 and
2.0 x86, otherwise, we expect the test to pass on other ruby platforms.

Reviewed-by: Josh Partlow <joshua.partlow@puppetlabs.com>

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU3952cccdb815: Merge branch 'master' of github.com:puppetlabs/puppet
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU9050bc1a087a: (maint) Expect test to fail on windows ruby 2.0 x86 (authored by Josh Cooper <josh@puppetlabs.com>).Sep 3 2014, 1:47 AM