Skip to content

Tests depend on current machine's timezone and fail #327

@Chosko

Description

@Chosko

I'm running tests on a machine with CET timezone and the result is

Failures:

  1) IceCube::Schedule next_occurrence should not skip ahead a day when called with a date
     Failure/Error: expect( next_hour ).to eq Time.utc(2014, 1, 2, 00, 34 , 56)

       expected: 2014-01-02 00:34:56 UTC
            got: 2014-01-01 12:34:56 UTC

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -2014-01-02 00:34:56 UTC
       +2014-01-01 12:34:56 UTC

     # ./spec/examples/schedule_spec.rb:42:in `block (3 levels) in <top (required)>'

  2) IceCube::Schedule occurring_at? should not capture multiple days when called with a date
     Failure/Error: expect( schedule.occurring_at?(Date.new(2014, 1, 1)) ).to eq true

       expected: true
            got: false

       (compared using ==)
     # ./spec/examples/schedule_spec.rb:74:in `block (3 levels) in <top (required)>'

  3) IceCube::Schedule next_occurrences should not skip ahead a day when called with a date
     Failure/Error: expect( next_hours ).to eq [Time.utc(2014, 1, 2, 00, 34 , 56),

       expected: [2014-01-02 00:34:56 UTC, 2014-01-02 01:34:56 UTC]
            got: [2014-01-01 12:34:56 UTC, 2014-01-01 13:34:56 UTC]

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -[2014-01-02 00:34:56 UTC, 2014-01-02 01:34:56 UTC]
       +[2014-01-01 12:34:56 UTC, 2014-01-01 13:34:56 UTC]

     # ./spec/examples/schedule_spec.rb:406:in `block (3 levels) in <top (required)>'

  4) IceCube::Schedule previous_occurrence should not skip back a day when called with a date
     Failure/Error: expect( prev_hour ).to eq Time.utc(2014, 1, 1, 23, 34 , 56)

       expected: 2014-01-01 23:34:56 UTC
            got: nil

       (compared using ==)
     # ./spec/examples/schedule_spec.rb:555:in `block (3 levels) in <top (required)>'

  5) IceCube::Schedule previous_occurrences should not skip back a day when called with a date
     Failure/Error: expect( prev_hours ).to eq [Time.utc(2014, 1, 1, 22, 34 , 56),

       expected: [2014-01-01 22:34:56 UTC, 2014-01-01 23:34:56 UTC]
            got: []

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -[2014-01-01 22:34:56 UTC, 2014-01-01 23:34:56 UTC]
       +[]

     # ./spec/examples/schedule_spec.rb:591:in `block (3 levels) in <top (required)>'

  6) IceCube::TimeUtil match_zone in UTC converts Date to beginning of date of reference time
     Failure/Error: expect(TimeUtil.match_zone(date, utc_time)).to eq utc_time - 1

       expected: 2014-01-01 00:00:00 UTC
            got: 2013-12-31 00:00:00 UTC

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -2014-01-01 00:00:00 UTC
       +2013-12-31 00:00:00 UTC

     # ./spec/examples/time_util_spec.rb:117:in `block (4 levels) in <module:IceCube>'

Finished in 1.48 seconds
961 examples, 6 failures, 2 pending

Failed examples:

rspec ./spec/examples/schedule_spec.rb:37 # IceCube::Schedule next_occurrence should not skip ahead a day when called with a date
rspec ./spec/examples/schedule_spec.rb:68 # IceCube::Schedule occurring_at? should not capture multiple days when called with a date
rspec ./spec/examples/schedule_spec.rb:401 # IceCube::Schedule next_occurrences should not skip ahead a day when called with a date
rspec ./spec/examples/schedule_spec.rb:550 # IceCube::Schedule previous_occurrence should not skip back a day when called with a date
rspec ./spec/examples/schedule_spec.rb:586 # IceCube::Schedule previous_occurrences should not skip back a day when called with a date
rspec ./spec/examples/time_util_spec.rb:116 # IceCube::TimeUtil match_zone in UTC converts Date to beginning of date of reference time

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions