Sha256: d02719b4b131e20788fcc090018a381331f55613b62d81683736daa0c27554b4

Contents?: true

Size: 1.97 KB

Versions: 20

Compression:

Stored size: 1.97 KB

Contents

require "helper"

if SimpleCov.usable?
  describe SimpleCov::CommandGuesser do
    subject { SimpleCov::CommandGuesser }
    it 'correctly guesses "Unit Tests" for unit tests' do
      subject.original_run_command = "/some/path/test/units/foo_bar_test.rb"
      expect(subject.guess).to eq("Unit Tests")
      subject.original_run_command = "test/units/foo.rb"
      expect(subject.guess).to eq("Unit Tests")
      subject.original_run_command = "test/foo.rb"
      expect(subject.guess).to eq("Unit Tests")
      subject.original_run_command = "test/{models,helpers,unit}/**/*_test.rb"
      expect(subject.guess).to eq("Unit Tests")
    end

    it 'correctly guesses "Functional Tests" for functional tests' do
      subject.original_run_command = "/some/path/test/functional/foo_bar_controller_test.rb"
      expect(subject.guess).to eq("Functional Tests")
      subject.original_run_command = "test/{controllers,mailers,functional}/**/*_test.rb"
      expect(subject.guess).to eq("Functional Tests")
    end

    it 'correctly guesses "Integration Tests" for integration tests' do
      subject.original_run_command = "/some/path/test/integration/foo_bar_controller_test.rb"
      expect(subject.guess).to eq("Integration Tests")
      subject.original_run_command = "test/integration/**/*_test.rb"
      expect(subject.guess).to eq("Integration Tests")
    end

    it 'correctly guesses "Cucumber Features" for cucumber features' do
      subject.original_run_command = "features"
      expect(subject.guess).to eq("Cucumber Features")
      subject.original_run_command = "cucumber"
      expect(subject.guess).to eq("Cucumber Features")
    end

    it 'correctly guesses "RSpec" for RSpec' do
      subject.original_run_command = "/some/path/spec/foo.rb"
      expect(subject.guess).to eq("RSpec")
    end

    it "defaults to RSpec because RSpec constant is defined" do
      subject.original_run_command = "some_arbitrary_command with arguments"
      expect(subject.guess).to eq("RSpec")
    end
  end
end

Version data entries

20 entries across 20 versions & 6 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
tdiary-5.0.9 vendor/bundle/gems/simplecov-0.14.1/spec/command_guesser_spec.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/spec/command_guesser_spec.rb
simplecov-0.15.1 spec/command_guesser_spec.rb
simplecov-0.15.0 spec/command_guesser_spec.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/spec/command_guesser_spec.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/spec/command_guesser_spec.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/spec/command_guesser_spec.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/spec/command_guesser_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simplecov-0.14.1/spec/command_guesser_spec.rb
simplecov-patched-0.14.3 spec/command_guesser_spec.rb
simplecov-patched-0.14.2 spec/command_guesser_spec.rb
simplecov-0.14.1 spec/command_guesser_spec.rb
simplecov-0.14.0 spec/command_guesser_spec.rb
simplecov-0.13.0 spec/command_guesser_spec.rb