Skip to content

Commit

Permalink
Add specs: Time.at raises ArgumentError if in keyword format is i…
Browse files Browse the repository at this point in the history
…nvalid
  • Loading branch information
ohbarye committed Oct 9, 2022
1 parent ec7d23d commit fe751cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/time/at_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,10 @@
time.zone.should == zone
time.to_i.should == @epoch_time
end

it "raises ArgumentError if format is invalid" do
-> { Time.at(@epoch_time, in: "+09:99") }.should raise_error(ArgumentError)
-> { Time.at(@epoch_time, in: "ABC") }.should raise_error(ArgumentError)
end
end
end

0 comments on commit fe751cb

Please sign in to comment.