Sha256: 0cae4fa286c304953e551f72e30a9a5501f6c82fb0d61fe45dac63ef7f87391b

Contents?: true

Size: 1.09 KB

Versions: 14

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'parallel_tests/cli'

describe ParallelTest::CLI do
  describe ".parse_options" do
    let(:defaults){ {:files => []} }

    def call(*args)
      ParallelTest::CLI.send(:parse_options!, *args)
    end

    it "parses regular count" do
      call(["-n3"]).should == defaults.merge(:count => 3)
    end

    it "parses count 0 as non-parallel" do
      call(["-n0"]).should == defaults.merge(:non_parallel => true)
    end

    it "parses non-parallel as non-parallel" do
      call(["--non-parallel"]).should == defaults.merge(:non_parallel => true)
    end
  end

  describe ".final_fail_message" do
    it 'returns a plain fail message if colors are nor supported' do
      ParallelTest::CLI.should_receive(:use_colors?).and_return false
      ParallelTest::CLI.send(:final_fail_message, "Test").should ==  "Tests Failed"
    end

    it 'returns a colorized fail message if colors are supported' do
      ParallelTest::CLI.should_receive(:use_colors?).and_return true
      ParallelTest::CLI.send(:final_fail_message, "Test").should == "\e[31mTests Failed\e[0m"
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
friendlyfashion-parallel_tests-0.9.0 spec/parallel_tests/cli_spec.rb
parallel_tests-0.9.4 spec/parallel_tests/cli_spec.rb
parallel_tests-0.9.3 spec/parallel_tests/cli_spec.rb
parallel_tests-0.9.2 spec/parallel_tests/cli_spec.rb
parallel_tests-0.9.1 spec/parallel_tests/cli_spec.rb
parallel_tests-0.9.0 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.14 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.13 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.12 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.11 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.10 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.9 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.8 spec/parallel_tests/cli_spec.rb
parallel_tests-0.8.7 spec/parallel_tests/cli_spec.rb