spec/lib/danica/function_spec.rb in danica-2.4.1 vs spec/lib/danica/function_spec.rb in danica-2.4.2
- old
+ new
@@ -118,19 +118,39 @@
it 'returns the full function description' do
expect(function.describe_tex).to eq('f(x, y) = x^{y}')
end
end
+
+ context 'when a variable is set as a constant' do
+ let(:function) do
+ function_class.new(name: :f, x: Danica::PI)
+ end
+
+ it do
+ expect(function.describe_tex).to eq('f(y) = \pi^{y}')
+ end
+ end
end
describe '#describe_gnu' do
context 'when function has a name' do
let(:function) do
function_class.new(name: :f)
end
it 'returns the full function description' do
expect(function.describe_gnu).to eq('f(x, y) = x**(y)')
+ end
+ end
+
+ context 'when a variable is set as a constant' do
+ let(:function) do
+ function_class.new(name: :f, x: Danica::PI)
+ end
+
+ it do
+ expect(function.describe_gnu).to eq('f(y) = pi**(y)')
end
end
end
describe 'spatial' do