spec/lib/rspec-virtus/matcher_spec.rb in rspec-virtus-1.0.0 vs spec/lib/rspec-virtus/matcher_spec.rb in rspec-virtus-1.0.1
- old
+ new
@@ -4,11 +4,11 @@
describe RSpec::Virtus::Matcher do
let(:instance) { described_class.new(attribute_name) }
let(:attribute_name) { :the_attribute }
class DummyVirtus
- include Virtus
+ include Virtus.model
attribute :the_attribute, String
attribute :the_array_attribute, Array[String]
end
@@ -92,19 +92,27 @@
expect(member_options_type).to eql(String)
end
end
end
+ describe '#description' do
+ subject { instance.description }
+
+ it 'tells you which attribute we are testing' do
+ expect(subject).to include(attribute_name.to_s)
+ end
+ end
+
describe '#failure_message' do
- subject { instance.negative_failure_message }
+ subject { instance.failure_message }
it 'tells you which attribute failed' do
expect(subject).to include(attribute_name.to_s)
end
end
- describe '#negative_failure_message' do
- subject { instance.negative_failure_message }
+ describe '#failure_message_when_negated' do
+ subject { instance.failure_message_when_negated }
it 'tells you which attribute failed' do
expect(subject).to include(attribute_name.to_s)
end
end