Sha256: d25be6c1d81db315ff413b90f670195e67408975c90ac34984f2d9f4d2e0ab35

Contents?: true

Size: 889 Bytes

Versions: 7

Compression:

Stored size: 889 Bytes

Contents

module Mutant
  class Killer
    # Runner for rspec tests
    class Rspec < self

    private

      # Run rspec test
      #
      # @return [true]
      #   when test is NOT successful
      #
      # @return [false]
      #   otherwise
      #
      # @api private
      #
      def run
        mutation.insert
        # TODO: replace with real streams from configuration
        require 'stringio'
        null = StringIO.new
        args = command_line_arguments
        begin
          !::RSpec::Core::Runner.run(args, null, null).zero?
        rescue StandardError
          true
        end
      end

      # Return command line arguments
      #
      # @return [Array]
      #
      # @api private
      #
      def command_line_arguments
        %W(
          --fail-fast
        ) + strategy.spec_files(mutation.subject)
      end

    end # Rspec
  end # Killer
end # Mutant

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.3.0.beta8 lib/mutant/killer/rspec.rb
mutant-0.3.0.beta7 lib/mutant/killer/rspec.rb
mutant-0.3.0.beta6 lib/mutant/killer/rspec.rb
mutant-0.3.0.beta5 lib/mutant/killer/rspec.rb
mutant-0.3.0.beta4 lib/mutant/killer/rspec.rb
mutant-0.3.0.beta3 lib/mutant/killer/rspec.rb
mutant-0.3.0.beta2 lib/mutant/killer/rspec.rb