spec/lib/danica/wrapper/variable_spec.rb in danica-2.7.4 vs spec/lib/danica/wrapper/variable_spec.rb in danica-2.7.5

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'spec_helper' describe Danica::Wrapper::Variable do it_behaves_like 'an object that respond to basic_methods' @@ -8,26 +10,27 @@ end it 'can be initialize from nil value' do expect do described_class.new(nil) - end + end.not_to raise_error end it 'can be initialize from nil name' do expect do described_class.new(name: nil) - end + end.not_to raise_error 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 } subject { described_class.new(value: value) } + + let(:value) { 100 } it 'returns the value' do expect(subject.to_f).to eq(value) end end