Sha256: dedcfdf497d38aa1c5ebfad3f5361784b9987e250650d34eae59dba8cc375a4b

Contents?: true

Size: 385 Bytes

Versions: 2

Compression:

Stored size: 385 Bytes

Contents

# encoding: utf-8

RSpec.describe Loaf::OptionsValidator, '.valid?' do
  let(:klass) { Class.extend Loaf::OptionsValidator }

  it 'validates succesfully known option' do
    expect(klass.valid?(match: :exact)).to eq(true)
  end

  it 'validates unknown option with an error' do
    expect {
      klass.valid?(invalid_param: true)
    }.to raise_error(Loaf::InvalidOptions)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loaf-0.8.1 spec/unit/options_validator_spec.rb
loaf-0.8.0 spec/unit/options_validator_spec.rb