brew/Library/Homebrew/test/string_spec.rb
Mike McQuaid 5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00

15 lines
368 B
Ruby

require "extend/string"
describe StringInreplaceExtension do
subject { string.extend(described_class) }
let(:string) { "foobar" }
describe "#sub!" do
it "adds an error to #errors when no replacement was made" do
subject.sub! "not here", "test"
expect(subject.errors).to eq(['expected replacement of "not here" with "test"'])
end
end
end