Sha256: f9e801190e4d22394c3a5f35d560eb24a1e594b05a3ef65f120adc162102bc5b
Contents?: true
Size: 769 Bytes
Versions: 23
Compression:
Stored size: 769 Bytes
Contents
shared_examples 'a variable method to formated string' do |method, format| let(:name) { :delta } let(:value) { 10.0 } let(:arguments) { { name: name, latex: '\delta', gnu: 'del' } } subject { described_class.new(arguments) } context "when #{format} is not defined" do before { arguments.delete(format) } it 'returns name' do expect(subject.public_send(method)).to eq('delta') end context 'when value is defined' do before { arguments[:value] = value } it 'returns the value' do expect(subject.public_send(method)).to eq('10') end end end context "when #{format} has been defined" do it "returns #{format}" do expect(subject.public_send(method)).to eq(arguments[format]) end end end
Version data entries
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
danica-2.0.4 | spec/support/shared_examples/variable.rb |
danica-2.0.3 | spec/support/shared_examples/variable.rb |
danica-2.0.2 | spec/support/shared_examples/variable.rb |