spec/attribute_spec.rb in attributor-6.5 vs spec/attribute_spec.rb in attributor-7.0
- old
+ new
@@ -321,21 +321,21 @@
let(:example) { 5 }
it { should be example }
end
context 'with a regexp' do
- let(:example) { /\w+/ }
+ let(:example) { Regexp.new(/\w+/) }
let(:generated_example) { /\w+/.gen }
it 'calls #gen on the regexp' do
expect(example).to receive(:gen).and_return(generated_example)
expect(example_result).to match example
end
context 'for a type with a non-String native_type' do
let(:type) { Attributor::Integer }
- let(:example) { /\d{5}/ }
+ let(:example) { Regexp.new(/\d{5}/) }
let(:generated_example) { /\d{5}/.gen }
it 'coerces the example value properly' do
expect(example).to receive(:gen).and_return(generated_example)
expect(type).to receive(:load).and_call_original