|
12 | 12 | let(:source) { 'a b' } |
13 | 13 |
|
14 | 14 | it 'returns #<Parser::Source::Range (string) 1...3>' do |
15 | | - expect(arguments_with_whitespace.begin_pos).to eq 1 |
16 | | - expect(arguments_with_whitespace.end_pos).to eq 3 |
| 15 | + expect(arguments_with_whitespace).to have_attributes( |
| 16 | + begin_pos: 1, |
| 17 | + end_pos: 3 |
| 18 | + ) |
17 | 19 | end |
18 | 20 | end |
19 | 21 |
|
20 | 22 | context 'when `foo 1, 2`' do |
21 | 23 | let(:source) { 'foo 1, 2' } |
22 | 24 |
|
23 | 25 | it 'returns #<Parser::Source::Range (string) 3...8>' do |
24 | | - expect(arguments_with_whitespace.begin_pos).to eq 3 |
25 | | - expect(arguments_with_whitespace.end_pos).to eq 8 |
| 26 | + expect(arguments_with_whitespace).to have_attributes( |
| 27 | + begin_pos: 3, |
| 28 | + end_pos: 8 |
| 29 | + ) |
26 | 30 | end |
27 | 31 | end |
28 | 32 |
|
29 | 33 | context 'when `foo(bar, baz)`' do |
30 | 34 | let(:source) { 'foo(bar, baz)' } |
31 | 35 |
|
32 | 36 | it 'returns #<Parser::Source::Range (string) 3...13>' do |
33 | | - expect(arguments_with_whitespace.begin_pos).to eq 3 |
34 | | - expect(arguments_with_whitespace.end_pos).to eq 13 |
| 37 | + expect(arguments_with_whitespace).to have_attributes( |
| 38 | + begin_pos: 3, |
| 39 | + end_pos: 13 |
| 40 | + ) |
35 | 41 | end |
36 | 42 | end |
37 | 43 | end |
|
64 | 70 | let(:source) { 'a { b }' } |
65 | 71 |
|
66 | 72 | it 'returns #<Parser::Source::Range (string) 1...7>' do |
67 | | - expect(block_with_whitespace.begin_pos).to eq 1 |
68 | | - expect(block_with_whitespace.end_pos).to eq 7 |
| 73 | + expect(block_with_whitespace).to have_attributes( |
| 74 | + begin_pos: 1, |
| 75 | + end_pos: 7 |
| 76 | + ) |
69 | 77 | end |
70 | 78 | end |
71 | 79 |
|
|
74 | 82 | let(:source) { 'foo { bar + baz }' } |
75 | 83 |
|
76 | 84 | it 'returns #<Parser::Source::Range (string) 3...17>' do |
77 | | - expect(block_with_whitespace.begin_pos).to eq 3 |
78 | | - expect(block_with_whitespace.end_pos).to eq 17 |
| 85 | + expect(block_with_whitespace).to have_attributes( |
| 86 | + begin_pos: 3, |
| 87 | + end_pos: 17 |
| 88 | + ) |
79 | 89 | end |
80 | 90 | end |
81 | 91 | end |
|
0 commit comments