Sha256: 4aafd9f6430301bdf780444e49f4777986de1537753198c0ca7e1e5ef6908979

Contents?: true

Size: 1.36 KB

Versions: 18

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe Guard::RSpec::Inspectors::Factory do
  let(:factory) { Guard::RSpec::Inspectors::Factory }
  let(:options) { {} }

  it 'can not be instantiated' do
    expect { factory.new(options) }.to raise_error(NoMethodError)
  end

  context 'with :focus failed mode and custom options' do
    let(:options) { { failed_mode: :focus, custom: 'value' } }

    it 'creates FocusedInspector instance with custom options' do
      inspector = factory.create(options)
      expect(inspector).to be_an_instance_of(Guard::RSpec::Inspectors::FocusedInspector)
      expect(inspector.options).to eq(options)
    end
  end

  context 'with :keep failed mode and custom options' do
    let(:options) { { failed_mode: :keep, custom: 'value' } }

    it 'creates KeepingInspector instance with custom options' do
      inspector = factory.create(options)
      expect(inspector).to be_an_instance_of(Guard::RSpec::Inspectors::KeepingInspector)
      expect(inspector.options).to eq(options)
    end
  end

  context 'with :none failed mode and custom options' do
    let(:options) { { failed_mode: :none, custom: 'value' } }

    it 'creates SimpleInspector instance with custom options' do
      inspector = factory.create(options)
      expect(inspector).to be_an_instance_of(Guard::RSpec::Inspectors::SimpleInspector)
      expect(inspector.options).to eq(options)
    end
  end
end

Version data entries

18 entries across 16 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/guard-rspec-4.3.1/spec/lib/guard/rspec/inspectors/factory_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/guard-rspec-4.3.1/spec/lib/guard/rspec/inspectors/factory_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/guard-rspec-4.3.1/spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.3.1 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.3.0 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.10 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.9 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.8 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.7 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.6 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.5 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.4 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.3 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.2 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.1 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.2.0 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.1.1 spec/lib/guard/rspec/inspectors/factory_spec.rb
guard-rspec-4.1.0 spec/lib/guard/rspec/inspectors/factory_spec.rb