Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 2279229

Browse files
committed
Fix taging feature on Ruby head
1 parent 3f10b72 commit 2279229

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

features/command_line/tag.feature

+12-22
Original file line numberDiff line numberDiff line change
@@ -39,66 +39,56 @@ Feature: `--tag` option
3939

4040
Scenario: Filter examples with a simple tag
4141
When I run `rspec . --tag focus`
42-
Then the output should contain "include {:focus=>true}"
42+
Then the output should print the included tags {focus: true}
4343
And the examples should all pass
4444

4545
Scenario: Filter examples with a simple tag and @
4646
When I run `rspec . --tag @focus`
47-
Then the output should contain "include {:focus=>true}"
47+
Then the output should print the included tags {focus: true}
4848
Then the examples should all pass
4949

5050
Scenario: Filter examples with a `name:value` tag
5151
When I run `rspec . --tag type:special`
52-
Then the output should contain:
53-
"""
54-
include {:type=>"special"}
55-
"""
52+
Then the output should print the included tags {type: "special"}
5653
And the output should contain "2 examples"
5754
And the examples should all pass
5855

5956
Scenario: Filter examples with a `name:value` tag and @
6057
When I run `rspec . --tag @type:special`
61-
Then the output should contain:
62-
"""
63-
include {:type=>"special"}
64-
"""
58+
Then the output should print the included tags {type: "special"}
6559
And the examples should all pass
6660

6761
Scenario: Exclude examples with a simple tag
6862
When I run `rspec . --tag ~skip`
69-
Then the output should contain "exclude {:skip=>true}"
63+
Then the output should print the excluded tags {skip: true}
7064
Then the examples should all pass
7165

7266
Scenario: Exclude examples with a simple tag and @
7367
When I run `rspec . --tag ~@skip`
74-
Then the output should contain "exclude {:skip=>true}"
68+
Then the output should print the excluded tags {skip: true}
7569
Then the examples should all pass
7670

7771
Scenario: Exclude examples with a `name:value` tag
7872
When I run `rspec . --tag ~speed:slow`
79-
Then the output should contain:
80-
"""
81-
exclude {:speed=>"slow"}
82-
"""
73+
Then the output should print the excluded tags {speed: "slow"}
8374
Then the examples should all pass
8475

8576
Scenario: Exclude examples with a `name:value` tag and @
8677
When I run `rspec . --tag ~@speed:slow`
87-
Then the output should contain:
88-
"""
89-
exclude {:speed=>"slow"}
90-
"""
78+
Then the output should print the excluded tags {speed: "slow"}
9179
Then the examples should all pass
9280

9381
Scenario: Filter examples with a simple tag, exclude examples with another tag
9482
When I run `rspec . --tag focus --tag ~skip`
95-
Then the output should contain "include {:focus=>true}"
96-
And the output should contain "exclude {:skip=>true}"
83+
Then the output should print the included tags {focus: true}
84+
And the output should print the excluded tags {skip: true}
9785
And the examples should all pass
9886

9987
Scenario: Exclude examples with multiple tags
10088
When I run `rspec . --tag ~skip --tag ~speed:slow`
10189
Then the output should contain one of the following:
10290
| exclude {:skip=>true, :speed=>"slow"} |
10391
| exclude {:speed=>"slow", :skip=>true} |
92+
| exclude {skip: true, speed: "slow"} |
93+
| exclude {speed: "slow", skip: true} |
10494
Then the examples should all pass

features/step_definitions/additional_cli_steps.rb

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
require './spec/support/formatter_support'
44

5+
# For Ruby 3.4.0 hash formatting
6+
Then /^the output should print the (include|exclude)d tags {(\w+): (.*)}$/ do |word, key, value|
7+
if RUBY_VERSION.to_f > 3.3
8+
expect(all_output).to include "#{word} {#{key}: #{value}}"
9+
else
10+
expect(all_output).to include "#{word} {:#{key}=>#{value}}"
11+
end
12+
end
13+
514
Then /^the output should contain all of these:$/ do |table|
615
table.raw.flatten.each do |string|
716
expect(all_output).to include(string)

0 commit comments

Comments
 (0)