Skip to content

Commit

Permalink
[Corrected] RSpec/IteratedExpectation
Browse files Browse the repository at this point in the history
Prefer using the all matcher instead of iterating over an array
  • Loading branch information
san983 committed Dec 10, 2020
1 parent f363936 commit 937fd76
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Expand Up @@ -19,12 +19,6 @@ RSpec/ContextWording:
RSpec/ExampleLength:
Enabled: false

# Offense count: 2
RSpec/IteratedExpectation:
Exclude:
- 'spec/dnsimple/client/services_domains_spec.rb'
- 'spec/dnsimple/client/services_spec.rb'

# Offense count: 1
RSpec/LeakyConstantDeclaration:
Exclude:
Expand Down
4 changes: 1 addition & 3 deletions spec/dnsimple/client/services_domains_spec.rb
Expand Up @@ -52,9 +52,7 @@
expect(service.sid).to be_a(String)
expect(service.description).to be_a(String)

service.settings.each do |service_setting|
expect(service_setting).to be_a(Dnsimple::Struct::Service::Setting)
end
expect(service.settings).to all(be_a(Dnsimple::Struct::Service::Setting))
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions spec/dnsimple/client/services_spec.rb
Expand Up @@ -49,9 +49,7 @@
expect(service.sid).to be_a(String)
expect(service.description).to be_a(String)

service.settings.each do |service_setting|
expect(service_setting).to be_a(Dnsimple::Struct::Service::Setting)
end
expect(service.settings).to all(be_a(Dnsimple::Struct::Service::Setting))
end
end
end
Expand Down

0 comments on commit 937fd76

Please sign in to comment.