diff --git a/spec/jira/base_spec.rb b/spec/jira/base_spec.rb index 26749bd5..573ad61c 100644 --- a/spec/jira/base_spec.rb +++ b/spec/jira/base_spec.rb @@ -301,7 +301,7 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc: response = instance_double('Response', body: '{"errorMessages":["blah"]}', status: 400) allow(subject).to receive(:new_record?) { false } expect(client).to receive(:put).with('/foo/bar', '{"invalid_field":"foobar"}').and_raise(JIRA::HTTPError.new(response)) - expect(-> { subject.save!('invalid_field' => 'foobar') }).to raise_error(JIRA::HTTPError) + expect{ subject.save!('invalid_field' => 'foobar') }.to raise_error(JIRA::HTTPError) end end @@ -579,9 +579,9 @@ class JIRA::Resource::BelongsToExample < JIRA::Base end it 'raises an exception when initialized without a belongs_to instance' do - expect(lambda { + expect{ JIRA::Resource::BelongsToExample.new(client, attrs: { 'id' => '123' }) - }).to raise_exception(ArgumentError, 'Required option :deadbeef missing') + }.to raise_exception(ArgumentError, 'Required option :deadbeef missing') end it 'returns the right url' do diff --git a/spec/support/shared_examples/integration.rb b/spec/support/shared_examples/integration.rb index 36910beb..1c3e0a17 100644 --- a/spec/support/shared_examples/integration.rb +++ b/spec/support/shared_examples/integration.rb @@ -55,9 +55,9 @@ def build_receiver stub_request(:put, site_url + subject.url) .to_return(status: 405, body: 'Some HTML') expect(subject.save('foo' => 'bar')).to be_falsey - expect(lambda do + expect do expect(subject.save!('foo' => 'bar')).to be_falsey - end).to raise_error(JIRA::HTTPError) + end.to raise_error(JIRA::HTTPError) end end @@ -115,9 +115,9 @@ def build_receiver it 'handles a 404' do stub_request(:get, site_url + described_class.singular_path(client, '99999', prefix)) .to_return(status: 404, body: '{"errorMessages":["' + class_basename + ' Does Not Exist"],"errors": {}}') - expect(lambda do + expect do client.send(class_basename).find('99999', options) - end).to raise_exception(JIRA::HTTPError) + end.to raise_exception(JIRA::HTTPError) end end @@ -170,8 +170,8 @@ def build_receiver subject.fetch expect(subject.save('fields' => { 'invalid' => 'field' })).to be_falsey - expect(lambda do + expect do subject.save!('fields' => { 'invalid' => 'field' }) - end).to raise_error(JIRA::HTTPError) + end.to raise_error(JIRA::HTTPError) end end