spec/lib/danica/variable_spec.rb in danica-2.0.1 vs spec/lib/danica/variable_spec.rb in danica-2.0.2
- old
+ new
@@ -1,15 +1,19 @@
require 'spec_helper'
describe Danica::Variable do
+ it_behaves_like 'an object with + operation' do
+ subject { described_class.new(value: 100) }
+ end
+
describe '#to_f' do
context 'when variable has no value' do
it { expect { subject.to_f }.to raise_error(Danica::Exception::NotDefined) }
end
context 'when variable has value' do
let(:value) { 100 }
- let(:subject) { described_class.new(value: value) }
+ subject { described_class.new(value: value) }
it 'returns the value' do
expect(subject.to_f).to eq(value)
end
end