spec/integration/readme/variables_spec.rb in danica-2.7.4 vs spec/integration/readme/variables_spec.rb in danica-2.7.5
- old
+ new
@@ -1,22 +1,24 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Danica::Wrapper::Variable do
describe '#to_tex' do
context 'when initializing with the name' do
subject do
- Danica::Wrapper::Variable.new(:x)
+ described_class.new(:x)
end
it do
expect(subject.to_tex).to eq('x')
end
end
context 'when initializing with a hash' do
subject do
- Danica::Wrapper::Variable.new(name: :x)
+ described_class.new(name: :x)
end
it do
expect(subject.to_tex).to eq('x')
end
@@ -100,20 +102,20 @@
end
describe 'automatic wrapp' do
let(:sum) do
Danica::DSL.build do
- power(:x, { name: :y }) + :z
+ power(:x, name: :y) + :z
end
end
let(:expected) do
Danica::Operator::Addition.new(
Danica::Operator::Power.new(
- Danica::Wrapper::Variable.new(:x),
- Danica::Wrapper::Variable.new(:y)
+ described_class.new(:x),
+ described_class.new(:y)
),
- Danica::Wrapper::Variable.new(:z)
+ described_class.new(:z)
)
end
it do
expect(sum).to eq(expected)