Sha256: d3e1bea62dba359753ec2ce828fae6c4832e9c50dff4e9a6ccee22d821b520c7

Contents?: true

Size: 893 Bytes

Versions: 3

Compression:

Stored size: 893 Bytes

Contents

require File.expand_path("../../spec_helper", __FILE__)

describe CukeQ::ScenarioRunner do

  def runner
    @runner ||= CukeQ::ScenarioRunner.new
  end

  it "returns an error if the job is incorrect" do
    runner.run({}) do |result|
      result[:success].should be_false
      result[:error].should_not be_empty
      result[:backtrace].should_not be_empty
    end
  end

  it "creates a configured and updated Scm instance" do
    job = {'scm' => {'url' => 'git://example.com/foo/bar', 'revision' => 'some-revision'}}

    CukeQ::Scm.should_receive(:new).with(CukeQ.root, job['scm']['url']).
               and_return(mock_scm = mock("scm"))

    mock_scm.should_receive(:current_revision).and_return 'another-revision'
    mock_scm.should_receive(:update).and_yield

    runner.scm_for(job).should == mock_scm
  end

  # important.
  it "executes the given job" do
    pending
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cukeq-0.0.1.dev4 spec/cukeq/scenario_runner_spec.rb
cukeq-0.0.1.dev3 spec/cukeq/scenario_runner_spec.rb
cukeq-0.0.1.dev2 spec/cukeq/scenario_runner_spec.rb