spec/lib/rspec-virtus/matcher_spec.rb in rspec-virtus-0.1.1 vs spec/lib/rspec-virtus/matcher_spec.rb in rspec-virtus-0.2.0
- old
+ new
@@ -15,66 +15,54 @@
describe '#matches?' do
subject { instance.matches?(actual) }
let(:actual) { DummyVirtus }
context 'successful match on attribute name' do
- it 'returns true' do
- expect(subject).to eql(true)
- end
+ it { is_expected.to eql(true) }
end
context 'successful match on attribute name and type' do
before do
instance.of_type(String)
end
- it 'returns true' do
- expect(subject).to eql(true)
- end
+ it { is_expected.to eql(true) }
end
context 'successful match on attribute name, type and member_type' do
let(:attribute_name) { :the_array_attribute }
before do
instance.of_type(Array, member_type: String)
end
- it 'returns true' do
- expect(subject).to eql(true)
- end
+ it { is_expected.to eql(true) }
end
context 'unsuccessful match on attribute name' do
let(:attribute_name) { :something_else }
- it 'returns false' do
- expect(subject).to eql(false)
- end
+ it { is_expected.to eql(false) }
end
context 'unsuccessful match on attribute name and type' do
let(:attribute_name) { :something_else }
before do
instance.of_type(Integer)
end
- it 'returns false' do
- expect(subject).to eql(false)
- end
+ it { is_expected.to eql(false) }
end
context 'unsuccessful match on attribute name, type and member_type' do
let(:attribute_name) { :the_array_attribute }
before do
instance.of_type(Array, member_type: Integer)
end
- it 'returns false' do
- expect(subject).to eql(false)
- end
+ it { is_expected.to eql(false) }
end
end
describe '#of_type' do
subject { instance.of_type(String) }