Sha256: 94b34cc0cee2bae1d29aceb24b711bfafbaa243de6abc466c7658ce300aa6e74

Contents?: true

Size: 411 Bytes

Versions: 3

Compression:

Stored size: 411 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  it 'validates succesfully known option' do
    expect(klass.valid?(crumb_length: 10)).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

3 entries across 3 versions & 1 rubygems

Version Path
loaf-0.6.0 spec/unit/options_validator_spec.rb
loaf-0.5.0 spec/unit/options_validator_spec.rb
loaf-0.4.0 spec/unit/options_validator_spec.rb