spec/unit/exceptions/name_error_spec.rb in evil-client-1.0.0 vs spec/unit/exceptions/name_error_spec.rb in evil-client-1.1.0
- old
+ new
@@ -1,12 +1,11 @@
RSpec.describe Evil::Client::NameError do
- let(:error) { described_class.new name, forbidden }
- let(:name) { "foo" }
- let(:forbidden) { %i[foo bar] }
+ let(:error) { described_class.new name }
+ let(:name) { "object_id" }
describe ".check!" do
- subject { described_class.check! name, forbidden }
+ subject { described_class.check! name }
context "with a valid name" do
let(:name) { "qux_3" }
it "symbolizes the name" do
@@ -53,11 +52,11 @@
expect { subject }.to raise_error described_class
end
end
context "with a forbidden name" do
- let(:name) { "foo" }
+ let(:name) { "object_id" }
it "raises itself" do
expect { subject }.to raise_error described_class
end
end
@@ -65,13 +64,9 @@
describe "#message" do
subject { error.message }
it "builds a proper error message" do
- expect(subject).to eq "Invalid name :foo." \
- " It should contain latin letters in the lower case," \
- " digits, and underscores only; have minimum 2 chars;" \
- " start from a letter; end with either letter or digit." \
- " The following names: 'foo', 'bar' are already used by Evil::Client."
+ expect(subject).to include "Invalid name :object_id."
end
end
end