Skip to content

Commit

Permalink
fix spec: explicit block for expect to raise_error
Browse files Browse the repository at this point in the history
  • Loading branch information
biinari committed Sep 1, 2022
1 parent 6483935 commit 72f5a21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/hutch/broker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
after { broker.disconnect }
let(:set_up_api_connection) { -> { broker.set_up_api_connection } }

specify { expect(set_up_api_connection).to raise_error(StandardError) }
specify { expect { set_up_api_connection }.to raise_error(StandardError) }
end
end

Expand Down
8 changes: 4 additions & 4 deletions spec/hutch/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
end

specify do
expect(invalid_get).to raise_error Hutch::UnknownAttributeError
expect { invalid_get }.to raise_error Hutch::UnknownAttributeError
end
end
end
Expand All @@ -57,7 +57,7 @@
end

specify do
expect(invalid_set).to raise_error Hutch::UnknownAttributeError
expect { invalid_set }.to raise_error Hutch::UnknownAttributeError
end
end
end
Expand All @@ -72,7 +72,7 @@

context 'for an invalid attribute' do
let(:invalid_getter) { -> { Hutch::Config.invalid_attr } }
specify { expect(invalid_getter).to raise_error NoMethodError }
specify { expect { invalid_getter }.to raise_error NoMethodError }
end

context 'for an ENV-overriden value attribute' do
Expand Down Expand Up @@ -110,7 +110,7 @@

context 'for an invalid attribute' do
let(:invalid_setter) { -> { Hutch::Config.invalid_attr = new_value } }
specify { expect(invalid_setter).to raise_error NoMethodError }
specify { expect { invalid_setter }.to raise_error NoMethodError }
end
end

Expand Down

0 comments on commit 72f5a21

Please sign in to comment.