Sha256: 481dfd479525056aea2b8266e0dd5c331d59f726739373039bf479c00ebae362
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' describe Danica::Equation do let(:clazz) do described_class.build(:x, :y) do left { y } right { x ** 2 } end end subject do clazz.new end it_behaves_like 'an object that respond to basic_methods' describe '.build' do it 'returns a class that is also an equation' do expect(subject).to be_a(Danica::Equation) end end describe '.create' do subject do described_class.create(:x, :y) do left { y } right { x ** 2 } end end it 'returns a class that is also an equation' do expect(subject).to be_a(Danica::Equation) end end describe '#to_f' do it do expect { subject.to_f }.to raise_error(Danica::Exception::NotImplemented) end end describe '#to_tex' do it 'joins the expressions in a equation' do expect(subject.to_tex).to eq('y = x^{2}') end end describe '#to_gnu' do it 'joins the expressions in a equation' do expect(subject.to_gnu).to eq('y = x**(2)') end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
danica-2.7.4 | spec/lib/danica/equation_spec.rb |
danica-2.7.3 | spec/lib/danica/equation_spec.rb |
danica-2.7.2 | spec/lib/danica/equation_spec.rb |
danica-2.7.1 | spec/lib/danica/equation_spec.rb |