Sha256: f8b25594fac73bb9858cbaccad0e8452824e7a3025b84bf16323b028884a8a89

Contents?: true

Size: 623 Bytes

Versions: 4

Compression:

Stored size: 623 Bytes

Contents

shared_examples 'an object that respond to basic_methods' do |ignore: [], methods: %i(to_f to_tex to_gnu priority valued? container? variable? variable_holder?)|
  (methods - ignore).each do |method|
    it { expect(subject).to respond_to(method) }
  end

  it 'accepts option on tex format' do
    expect do
      subject.to_tex(decimals: 2)
    end.not_to raise_error
  end

  it 'accepts option on gnu format' do
    expect do
      subject.to_gnu(decimals: 2)
    end.not_to raise_error
  end

  it 'accepts option on to format' do
    expect do
      subject.to(:gnu, decimals: 2)
    end.not_to raise_error
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
danica-2.7.4 spec/support/shared_examples/common.rb
danica-2.7.3 spec/support/shared_examples/common.rb
danica-2.7.2 spec/support/shared_examples/common.rb
danica-2.7.1 spec/support/shared_examples/common.rb