Class: Mutant::Strategy::Rspec::ExampleLookup

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/mutant/strategy/rspec/example_lookup.rb

Overview

Example lookup for rspec

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#mutationMutation (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return mutation

Returns:



27
28
29
# File 'lib/mutant/strategy/rspec/example_lookup.rb', line 27

def mutation
  @mutation
end

Class Method Details

.run(mutation) ⇒ Enumerable<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Perform example lookup

Parameters:

Returns:

  • (Enumerable<String>)


17
18
19
# File 'lib/mutant/strategy/rspec/example_lookup.rb', line 17

def self.run(mutation)
  new(mutation).spec_files
end

Instance Method Details

#spec_filesEnumerable<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return spec files

Returns:

  • (Enumerable<String>)


35
36
37
38
39
40
41
42
43
44
# File 'lib/mutant/strategy/rspec/example_lookup.rb', line 35

def spec_files
  expression = glob_expression
  files = Dir[expression]

  if files.empty?
    $stderr.puts("Spec file(s): #{expression.inspect} not found for #{mutation.identification}")
  end

  files
end