Sha256: c7aef2dd2e26bcaf2719342e4f696a2dd51d16d58ab8c7d2382270202e925798

Contents?: true

Size: 1.03 KB

Versions: 23

Compression:

Stored size: 1.03 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) {stub("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

23 entries across 23 versions & 1 rubygems

Version Path
gorgon-0.4.0 spec/mini_test_runner_spec.rb
gorgon-0.4.0.rc2 spec/mini_test_runner_spec.rb
gorgon-0.4.0.rc1 spec/mini_test_runner_spec.rb