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.18.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.18.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.17.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.16.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.15.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.14.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.13.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.12.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.11.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.10.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.10.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.9.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.8.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.7.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.6.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.5.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.4.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.3.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.2.1 spec/knapsack_pro/adapters/spinach_adapter_spec.rb
knapsack_pro-2.2.0 spec/knapsack_pro/adapters/spinach_adapter_spec.rb