Class: SpeCuke::Target::ProductCode

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/spe_cuke/target/product_code.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#execute!, inherited, #initialize

Constructor Details

This class inherits a constructor from SpeCuke::Target::Base

Class Attribute Details

.default_optionsObject

Returns the value of attribute default_options.



9
10
11
# File 'lib/spe_cuke/target/product_code.rb', line 9

def default_options
  @default_options
end

Class Method Details

.paired_test(file) ⇒ Object



14
15
16
17
18
19
# File 'lib/spe_cuke/target/product_code.rb', line 14

def paired_test(file)
  top, *rests = file.split('/')
  return nil unless %w[lib app].include?(top)
  spec = File.basename(rests.pop, '.rb') + '_spec.rb'
  exactlly_paired(rests, spec) || fuzzy_paired(rests, spec)
end

.suitable?(file) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/spe_cuke/target/product_code.rb', line 10

def suitable?(file)
  !!paired_test(file)
end