Skip to content

Commit 3f2ae25

Browse files
authored
Merge pull request #293 from plural/spec-and-test-lint
Fix lint issues for test/ and spec/ dirs.
2 parents 27c7c5f + 344b407 commit 3f2ae25

30 files changed

+523
-465
lines changed

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ Metrics/PerceivedComplexity:
1414
Enabled: false
1515
Rails/HasManyOrHasOneDependent:
1616
Enabled: false
17+
RSpec/ExampleLength:
18+
Enabled: false
19+
RSpec/ExampleWording:
20+
Enabled: false
21+
RSpec/FilePath:
22+
Enabled: false
23+
RSpec/MultipleExpectations:
24+
Enabled: false

spec/acceptance/card_cycles_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card Cycle resources have the following relationships for their records.
1414
1515
* Card Sets
1616
* Cards
1717
* Printings
18-
HEREDOC
18+
EXPLANATION
1919

2020
get '/api/v3/public/card_cycles' do
2121
example_request 'All Card Cycles' do

spec/acceptance/card_pools_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card Pool resources have the following relationships for their records.
@@ -16,7 +16,7 @@
1616
* Card Sets
1717
* Format
1818
* Snapshots
19-
HEREDOC
19+
EXPLANATION
2020

2121
get '/api/v3/public/card_pools' do
2222
example_request 'All Card Pools' do

spec/acceptance/card_set_types_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card Set Type resources have the following relationships for their records.
1414
1515
* Card Sets
16-
HEREDOC
16+
EXPLANATION
1717

1818
get '/api/v3/public/card_set_types' do
1919
example_request 'All Card Set Types' do

spec/acceptance/card_sets_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card Set resources have the following relationships for their records.
@@ -16,7 +16,7 @@
1616
* Card Set Type
1717
* Cards
1818
* Printings
19-
HEREDOC
19+
EXPLANATION
2020

2121
get '/api/v3/public/card_sets' do
2222
example_request 'All Card Sets' do

spec/acceptance/card_subtype_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card Subtype resources have the following relationships for their records.
1414
1515
* Cards
1616
* Printings
17-
HEREDOC
17+
EXPLANATION
1818

1919
get '/api/v3/public/card_subtypes' do
2020
example_request 'All Card Subtypes' do

spec/acceptance/card_type_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card Type resources have the following relationships for their records.
1414
1515
* Cards
1616
* Printings
1717
* Side
18-
HEREDOC
18+
EXPLANATION
1919

2020
get '/api/v3/public/card_types' do
2121
example_request 'All Card Types' do

spec/acceptance/cards_spec.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Card resources have the following relationships for their records.
@@ -21,7 +21,7 @@
2121
* Printings
2222
* Rulings
2323
* Side
24-
HEREDOC
24+
EXPLANATION
2525

2626
get '/api/v3/public/cards' do
2727
example_request 'All Cards' do
@@ -43,12 +43,15 @@
4343

4444
# TODO(plural): Enforce sort order by type and primary field name.
4545
fields = CardSearchQueryBuilder.fields.map do |x|
46-
format('* **%s**: Type: %s%s', x.keywords.join(', '), x.type.to_s,
47-
x.documentation.nil? ? '' : "\n * %s" % x.documentation)
46+
format('* **%<keywords>s**: Type: %<type>s%<documentation>s',
47+
keywords: x.keywords.join(', '),
48+
type: x.type.to_s,
49+
documentation: x.documentation.nil? ? '' : "\n * #{x.documentation}")
4850
end
4951
let(:query) { 'gamble' }
5052
example_request 'Filter - Card Search Operator' do
51-
explanation format("%s\n### Fields and their types\n%s", SearchQueryBuilder.search_filter_docs, fields.join("\n"))
53+
explanation format("%<docs>s\n### Fields and their types\n%<fields>s",
54+
docs: SearchQueryBuilder.search_filter_docs, fields: fields.join("\n"))
5255

5356
expect(status).to eq 200
5457
end

spec/acceptance/decklists_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
Decklists are published decks from users.
1212
1313
## Relationships
@@ -19,7 +19,7 @@
1919
* Identity Card
2020
* Cards
2121
22-
HEREDOC
22+
EXPLANATION
2323

2424
get '/api/v3/public/decklists' do
2525
example_request 'All Decklists' do
@@ -40,12 +40,12 @@
4040
parameter :card_id, type: :string, required: true
4141

4242
example_request 'Filter - Get decklists containing all supplied Card ids' do
43-
explanation <<~EOM
43+
explanation <<~EXPLANATION
4444
The card_id filter can accept a single card_id or a comma-separated list of card ids.
4545
4646
If multiple card ids are supplied, the decklist must contain all of the
4747
cards to be included in the results.
48-
EOM
48+
EXPLANATION
4949

5050
expect(status).to eq 200
5151
end

spec/acceptance/factions_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
header 'Content-Type', 'application/json'
88
header 'Host', 'api-preview.netrunnerdb.com'
99

10-
explanation <<~HEREDOC
10+
explanation <<~EXPLANATION
1111
## Relationships
1212
1313
Faction resources have the following relationships for their records.
@@ -16,7 +16,7 @@
1616
* Decklists
1717
* Printings
1818
* Side
19-
HEREDOC
19+
EXPLANATION
2020

2121
get '/api/v3/public/factions' do
2222
example_request 'All Factions' do

0 commit comments

Comments
 (0)