File tree Expand file tree Collapse file tree 4 files changed +14
-9
lines changed
Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 22--format documentation
33--color
44<% if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7') %>
5- --exclude-pattern spec/pattern_matching_spec. rb
5+ --exclude-pattern spec/pattern_matching_spec. rb,spec/range_of_endless_spec . rb
66<% end %>
Original file line number Diff line number Diff line change 1+ # Only works in Ruby 2.7+
12RSpec . describe ValueSemantics , 'pattern matching integration' do
23 shared_examples 'pattern matching' do
34 it 'deconstructs to a hash' do
Original file line number Diff line number Diff line change 1+ # Only works in Ruby 2.6+
2+ RSpec . describe ValueSemantics ::RangeOf do
3+ subject { described_class . new ( Integer ) }
4+
5+ it 'matches beginless ranges' do
6+ is_expected . to be === ( 1 ..)
7+ end
8+
9+ it 'matches endless ranges' do
10+ is_expected . to be === ( ..10 )
11+ end
12+ end
Original file line number Diff line number Diff line change 55 is_expected . to be === ( 1 ..10 )
66 end
77
8- it 'matches beginless ranges' do
9- is_expected . to be === ( 1 ..)
10- end
11-
12- it 'matches endless ranges' do
13- is_expected . to be === ( ..10 )
14- end
15-
168 it 'does not match ranges whose `begin` does not match the subvalidator' do
179 expect ( subject === ( 1.0 ..10 ) ) . to be ( false )
1810 end
You can’t perform that action at this time.
0 commit comments