Skip to content

Commit

Permalink
Add spec for Range#include? with Time endpoints.
Browse files Browse the repository at this point in the history
See #4231.
  • Loading branch information
headius committed Oct 18, 2016
1 parent a061b5c commit 34a6af3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby/core/range/shared/include.rb
Expand Up @@ -76,4 +76,16 @@
end
end
end

describe "with Time endpoints" do
it "uses cover? logic" do
now = Time.now
range = (now..(now + 60))

range.include?(now).should == true
range.include?(now - 1).should == false
range.include?(now + 60).should == true
range.include?(now + 61).should == false
end
end
end

0 comments on commit 34a6af3

Please sign in to comment.