diff --git a/spec/bulldoze_renamer/shell_spec.rb b/spec/bulldoze_renamer/shell_spec.rb index c3a1daf..d7ad7c6 100644 --- a/spec/bulldoze_renamer/shell_spec.rb +++ b/spec/bulldoze_renamer/shell_spec.rb @@ -5,13 +5,13 @@ it "exits without replacing if no argument is passed" do argv = [] expect(err_double).to receive(:puts).with ::BulldozeRenamer::Shell::BANNER - expect(lambda { ::BulldozeRenamer::Shell.start( argv, out: out_double, err: err_double) }).to raise_error SystemExit + expect{::BulldozeRenamer::Shell.start( argv, out: out_double, err: err_double)}.to raise_error SystemExit end it "exits without replacing if one argument is passed" do argv = ['one'] expect(err_double).to receive(:puts).with ::BulldozeRenamer::Shell::BANNER - expect(lambda { ::BulldozeRenamer::Shell.start( argv, out: out_double, err: err_double) }).to raise_error SystemExit + expect{::BulldozeRenamer::Shell.start( argv, out: out_double, err: err_double)}.to raise_error SystemExit end it "performs a replace if there are exactly two arguments" do @@ -34,7 +34,7 @@ it "exits without replacing if more than two arguments are passed" do argv = ['.', 'one', 'two', 'three'] expect(err_double).to receive(:puts).with ::BulldozeRenamer::Shell::BANNER - expect(lambda { ::BulldozeRenamer::Shell.start( argv, out: out_double, err: err_double) }).to raise_error SystemExit + expect{::BulldozeRenamer::Shell.start( argv, out: out_double, err: err_double)}.to raise_error SystemExit expect(::BulldozeRenamer::RenamingOrchestrator).not_to receive(:rename_with_options) end diff --git a/spec/bulldoze_renamer/string_inflector_spec.rb b/spec/bulldoze_renamer/string_inflector_spec.rb index 0b74470..bb3c43c 100644 --- a/spec/bulldoze_renamer/string_inflector_spec.rb +++ b/spec/bulldoze_renamer/string_inflector_spec.rb @@ -84,12 +84,12 @@ end it "raises an error if the current string does not map to any of the inflections" do - expect(-> { BulldozeRenamer::StringInflector.new('current does-Not_Reflect', 'whatevs').mappings }). + expect { BulldozeRenamer::StringInflector.new('current does-Not_Reflect', 'whatevs').mappings }. to raise_error(BulldozeRenamer::StringInflector::StringDoesNotInflectToItselfError, "current does-Not_Reflect") end it "raises an error if the target string does not map to any of the inflections" do - expect(-> { BulldozeRenamer::StringInflector.new('whatevs', 'target does-Not_Reflect').mappings }). + expect { BulldozeRenamer::StringInflector.new('whatevs', 'target does-Not_Reflect').mappings }. to raise_error(BulldozeRenamer::StringInflector::StringDoesNotInflectToItselfError, "target does-Not_Reflect") end