Sha256: 394432ee0cfb51420ac8e919ff570eec0f38f8669395e151901c0dce61734954

Contents?: true

Size: 1.04 KB

Versions: 15

Compression:

Stored size: 1.04 KB

Contents

require 'gorgon/mini_test_runner'

describe MiniTestRunner do
  subject {MiniTestRunner}
  it {should respond_to(:run_file).with(1).argument}
  it {should respond_to(:runner).with(0).argument}

  describe "#run_file" do

    let(:runner) {double("MiniTestUnitRunner", :run => nil, :report => ["report"])}
    before do
      Object.stub(:load)
      MiniTestUnitRunner.stub(:new).and_return(runner)
    end

    it "clear test cases previously loaded (when a previous file was loaded), and then loads filename" do
      MiniTest::Unit::TestCase.should_receive(:reset).ordered
      Object.should_receive(:load).with("file_test.rb").ordered
      MiniTestRunner.run_file "file_test.rb"
    end

    it "runs the MiniTestUnitRunner" do
      runner.should_receive(:run)
      MiniTestRunner.run_file "file_test.rb"
    end

    it "returns runner's report" do
      MiniTestRunner.run_file("file_test.rb").should == ["report"]
    end
  end

  describe ".runner" do
    it "returns :minitest" do
      MiniTestRunner.runner.should == :minitest
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gorgon-0.11.0 spec/mini_test_runner_spec.rb
gorgon-0.10.5 spec/mini_test_runner_spec.rb
gorgon-0.10.4 spec/mini_test_runner_spec.rb
gorgon-0.10.3 spec/mini_test_runner_spec.rb
gorgon-0.10.2 spec/mini_test_runner_spec.rb
gorgon-0.10.1 spec/mini_test_runner_spec.rb
gorgon-0.10.0 spec/mini_test_runner_spec.rb
gorgon-0.9.0 spec/mini_test_runner_spec.rb
gorgon-0.8.4 spec/mini_test_runner_spec.rb
gorgon-0.8.3 spec/mini_test_runner_spec.rb
gorgon-0.8.2 spec/mini_test_runner_spec.rb
gorgon-0.8.1 spec/mini_test_runner_spec.rb
gorgon-0.8.0 spec/mini_test_runner_spec.rb
gorgon-0.7.1 spec/mini_test_runner_spec.rb
gorgon-0.7.0 spec/mini_test_runner_spec.rb