Sha256: 447f06ed63954e1b5eebb6298c44db8cf503a3c982397d0525ddd2a99d6dd1ed

Contents?: true

Size: 1.83 KB

Versions: 149

Compression:

Stored size: 1.83 KB

Contents

describe KnapsackPro::Adapters::SpinachAdapter do
  it do
    expect(described_class::TEST_DIR_PATTERN).to eq 'features/**{,/*/**}/*.feature'
  end

  context do
    it_behaves_like 'adapter'
  end

  describe '.test_path' do
    let(:scenario_data) do
      double(feature: double(filename: 'a.feature'))
    end

    subject { described_class.test_path(scenario_data) }

    it { should eql 'a.feature' }
  end

  describe 'bind methods' do
    describe '#bind_time_tracker' do
      let(:block) { double }
      let(:tracker) { instance_double(KnapsackPro::Tracker) }
      let(:logger) { instance_double(Logger) }
      let(:global_time) { 'Global time: 01m 05s' }
      let(:test_path) { 'features/a.feature' }
      let(:scenario_data) do
        double(feature: double(filename: test_path))
      end

      it do
        expect(Spinach.hooks).to receive(:before_scenario).and_yield(scenario_data, nil)

        allow(KnapsackPro).to receive(:tracker).and_return(tracker)
        expect(described_class).to receive(:test_path).with(scenario_data).and_return(test_path)
        expect(tracker).to receive(:current_test_path=).with(test_path)
        expect(tracker).to receive(:start_timer)

        expect(Spinach.hooks).to receive(:after_scenario).and_yield
        expect(tracker).to receive(:stop_timer)

        expect(Spinach.hooks).to receive(:after_run).and_yield
        expect(KnapsackPro::Presenter).to receive(:global_time).and_return(global_time)
        expect(KnapsackPro).to receive(:logger).and_return(logger)
        expect(logger).to receive(:debug).with(global_time)

        subject.bind_time_tracker
      end
    end

    describe '#bind_save_report' do
      it do
        expect(Spinach.hooks).to receive(:after_run).and_yield

        expect(KnapsackPro::Report).to receive(:save)

        subject.bind_save_report
      end
    end
  end
end

Version data entries

149 entries across 149 versions & 1 rubygems

Version Path
knapsack_pro-2.1.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.1.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.0.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.22.3 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.22.2 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.22.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.22.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.21.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.20.2 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.20.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.20.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.19.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.18.2 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.18.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.18.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.17.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.16.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.16.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.15.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-1.14.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb