Skip to content

Commit

Permalink
Add failing spec for fugit#67
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Mar 9, 2022
1 parent bd4c1e9 commit eb0f540
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions spec/eo_time_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -525,15 +525,25 @@

describe '#wday_in_month' do

it 'computes the wday in month interval' do
{

t = EtOrbi::EoTime.new(1193898300, 'Europe/Paris')
[ 1193898300, 'Europe/Paris' ] => [ 1, -5 ],
'2017-06-21 Europe/Paris' => [ 3, -2 ],
'2022-03-29 UTC' => [ 5, -1 ],
'2022-03-29 Europe/Paris' => [ 5, -1 ],

expect(t.wday_in_month).to eq([ 1, -5 ])
}.each do |k, v|

t = EtOrbi.make_time('2017-06-21 Europe/Paris')
it "computes the wday in month interval for #{k.inspect}" do

expect(t.wday_in_month).to eq([ 3, -2 ])
t =
case k
when String then EtOrbi.make_time(k)
else EtOrbi::EoTime.new(*k)
end

expect(t.wday_in_month).to eq(v)
end
end
end

Expand Down

0 comments on commit eb0f540

Please sign in to comment.