Sha256: 7f87808cb35b2f3294a646ba637c4af72b92d999bcb9c2f36a2d233a2378cff0

Contents?: true

Size: 529 Bytes

Versions: 3

Compression:

Stored size: 529 Bytes

Contents

describe Hashr::Delegate::Conditional do
  let(:klass) { Class.new(Hashr) { include Hashr::Delegate::Conditional } }

  it 'delegates key?' do
    hashr = klass.new(foo: 'foo')
    expect(hashr.key?(:foo)).to eq(true)
  end

  it 'delegates select' do
    hashr = klass.new(foo: 'foo', bar: 'bar')
    expect(hashr.select { |key, value| key == :bar }.to_h).to eq(bar: 'bar')
  end

  it 'delegates delete' do
    hashr = klass.new(foo: 'foo', bar: 'bar')
    hashr.delete(:foo)
    expect(hashr.to_h).to eq(bar: 'bar')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hashr-2.0.1 spec/hashr/delegate/conditional_spec.rb
hashr-2.0.0 spec/hashr/delegate/conditional_spec.rb
hashr-2.0.0.rc2 spec/hashr/delegate/conditional_spec.rb