Skip to content

Commit

Permalink
Fix specs broken in 4.3 (#366)
Browse files Browse the repository at this point in the history
Due to openhab/openhab-core#3583

Signed-off-by: Cody Cutrer <[email protected]>
  • Loading branch information
ccutrer authored Dec 10, 2024
1 parent a6176c5 commit 563213a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/openhab/core/types/date_time_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def wday
#
# @return [String] The timezone in `[+-]hh:mm(:ss)` format (`Z` for UTC)
#
# @deprecated This method has been deprecated in openHAB 4.3.
def zone
zoned_date_time.zone.id
end
Expand Down
7 changes: 6 additions & 1 deletion spec/openhab/core/types/date_time_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
specify { expect(date2.wday).to be 0 }
specify { expect(date2).to be_utc }
specify { expect(date2.month).to be 1 }
specify { expect(date2.zone).to eql "Z" }

if OpenHAB::Core.version < OpenHAB::Core::V4_3
specify { expect(date2.zone).to eql "Z" }
else
specify { expect(date2.zone).to eql "Etc/UTC" }
end
end

it "considers same time but different zone to be equal" do
Expand Down
2 changes: 1 addition & 1 deletion spec/openhab/core_ext/ephemeris_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

it "returns nil for a non-holiday" do
expect(LocalDate.parse("2022-12-26").holiday).to be_nil
expect(LocalDate.parse("2022-12-27").holiday).to be_nil
end
end

Expand Down

0 comments on commit 563213a

Please sign in to comment.