Sha256: 6b41655e82840b25dcb054278025dfd010f744b04ae058104e24001a36dc1ff2

Contents?: true

Size: 1017 Bytes

Versions: 3

Compression:

Stored size: 1017 Bytes

Contents

require 'spec_helper'

describe Idid::Configuration do
  subject { Idid::Configuration.new('project' => project, 'email' => email, 'delivery' => delivery) }
  let(:email) { 'foo@example.com' }
  let(:project) { 'foobar' }
  let(:delivery) { {:method => :sendmail} }

  before { Idid::Configuration.any_instance.stub(:read_config) { nil } }

  its('project') { should eq project }
  its('email')   { should eq email   }

  it 'raises ArgumentError if no email option is passed' do
    expect { Idid::Configuration.new('project' => project, 'delivery' => delivery) }.
      to raise_error(ArgumentError, /email/)
  end

  it 'raises ArgumentError if no project option is passed' do
    expect { Idid::Configuration.new('email' => email, 'delivery' => delivery) }.
      to raise_error(ArgumentError, /project/)
  end

  it 'raises ArgumentError if no delivery option is passed' do
    expect { Idid::Configuration.new('email' => email, 'project' => project) }.
      to raise_error(ArgumentError, /delivery/)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
idid-0.0.3 spec/idid/configuration_spec.rb
idid-0.0.2 spec/idid/configuration_spec.rb
idid-0.0.1 spec/idid/configuration_spec.rb