Class: Cucumber::FileSpecs::FileSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/file_specs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s) ⇒ FileSpec



23
24
25
26
27
# File 'lib/cucumber/file_specs.rb', line 23

def initialize(s)
  @file, @lines = *FILE_COLON_LINE_PATTERN.match(s).captures
  Cucumber.logger.debug("  * #{@file}\n")
  @lines = String(@lines).split(':').map { |line| Integer(line) }
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



29
30
31
# File 'lib/cucumber/file_specs.rb', line 29

def file
  @file
end

Instance Method Details

#locationsObject



31
32
33
34
# File 'lib/cucumber/file_specs.rb', line 31

def locations
  return [ Core::Ast::Location.new(@file) ] if @lines.empty?
  @lines.map { |line| Core::Ast::Location.new(@file, line) }
end