spec/lib/protobuf/field_spec.rb in protobuf-3.3.6 vs spec/lib/protobuf/field_spec.rb in protobuf-3.4.0

- old
+ new

@@ -1,9 +1,9 @@ require 'spec_helper' require 'protobuf/field' -describe ::Protobuf::Field do +RSpec.describe ::Protobuf::Field do describe '.build' do pending end @@ -146,33 +146,30 @@ expect(subject.field_type(expected_field)).to eq(expected_field) expect(subject.field_type(:sfixed64)).to eq(expected_field) end end - context 'when type is a string field class or symbol' do it 'returns that class' do expected_field = ::Protobuf::Field::StringField expect(subject.field_class(expected_field)).to eq(expected_field) expect(subject.field_class(:string)).to eq(expected_field) expect(subject.field_type(expected_field)).to eq(expected_field) expect(subject.field_type(:string)).to eq(expected_field) end end - context 'when type is a bytes field class or symbol' do it 'returns that class' do expected_field = ::Protobuf::Field::BytesField expect(subject.field_class(expected_field)).to eq(expected_field) expect(subject.field_class(:bytes)).to eq(expected_field) expect(subject.field_type(expected_field)).to eq(expected_field) expect(subject.field_type(:bytes)).to eq(expected_field) end end - context 'when type is a bool field class or symbol' do it 'returns that class' do expected_field = ::Protobuf::Field::BoolField expect(subject.field_class(expected_field)).to eq(expected_field) expect(subject.field_class(:bool)).to eq(expected_field) @@ -181,12 +178,12 @@ end end context 'when type is not mapped' do it 'raises an ArgumentError' do - expect { + expect do subject.field_class("boom") - }.to raise_error + end.to raise_error end end end