spec/integration/yard/arstotzka/method_builder_spec.rb in arstotzka-1.3.2 vs spec/integration/yard/arstotzka/method_builder_spec.rb in arstotzka-1.4.0
- old
+ new
@@ -5,23 +5,22 @@
describe Arstotzka::MethodBuilder do
describe 'yard' do
subject(:builder) { described_class.new(attributes, klass, options) }
let!(:instance) { klass.new(hash) }
- let(:options) { Arstotzka::Options.new(options_hash) }
let(:hash) do
{
'name' => { first: 'John', last: 'Williams' },
:age => '20',
'cars' => 2.0
}
end
describe '#first_name' do
- let(:klass) { Class.new(MyModel) }
- let(:attributes) { [:first_name] }
- let(:options_hash) { { full_path: 'name.first' } }
+ let(:klass) { Class.new(MyModel) }
+ let(:attributes) { [:first_name] }
+ let(:options) { { full_path: 'name.first' } }
before do
builder.build
end
@@ -29,13 +28,13 @@
expect(instance.first_name).to eq('John')
end
end
describe '#age' do
- let(:klass) { Class.new(MyModel) }
- let(:attributes) { %i[age cars] }
- let(:options_hash) { { type: :integer } }
+ let(:klass) { Class.new(MyModel) }
+ let(:attributes) { %i[age cars] }
+ let(:options) { { type: :integer } }
before do
builder.build
end
@@ -47,12 +46,12 @@
expect(instance.age).to be_a(Integer)
end
end
describe '#cars' do
- let(:klass) { Class.new(MyModel) }
- let(:attributes) { %i[age cars] }
- let(:options_hash) { { type: :integer } }
+ let(:klass) { Class.new(MyModel) }
+ let(:attributes) { %i[age cars] }
+ let(:options) { { type: :integer } }
before do
builder.build
end