spec/lib/danica/wrapper/constant_spec.rb in danica-2.7.4 vs spec/lib/danica/wrapper/constant_spec.rb in danica-2.7.5
- old
+ new
@@ -1,9 +1,12 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Danica::Wrapper::Constant do
subject { described_class.new(2.5, :M, :m) }
+
let(:other) { described_class.new(3, :N, :n) }
it_behaves_like 'an object that respond to basic_methods'
it_behaves_like 'an object with basic operation'
@@ -23,26 +26,30 @@
context 'when requesting :tex' do
it 'has a string for latex' do
expect(subject.to(:tex)).to eq('M')
end
end
+
context "when requesting 'tex'" do
it 'has a string for latex' do
expect(subject.to('tex')).to eq('M')
end
end
+
context 'when requesting :gnu' do
it 'has a string for gnu' do
expect(subject.to(:gnu)).to eq('m')
end
end
+
context "when requesting 'gnu'" do
it 'has a string for gnu' do
expect(subject.to('gnu')).to eq('m')
end
end
- context "when requesting wrong format" do
+
+ context 'when requesting wrong format' do
it do
expect do
subject.to('format')
end.to raise_error(Danica::Exception::FormattedNotFound)
end
@@ -93,11 +100,11 @@
it { expect(subject).not_to eq(other) }
end
context 'with same values' do
let(:other) { described_class.new(2.5, :M, :m) }
+
it { expect(subject).to eq(other) }
end
end
end
end
-