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(spec) ⇒ FileSpec

Returns a new instance of FileSpec.



25
26
27
28
29
# File 'lib/cucumber/file_specs.rb', line 25

def initialize(spec)
  @file, @lines = *FILE_COLON_LINE_PATTERN.match(spec).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.



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

def file
  @file
end

Instance Method Details

#locationsObject



33
34
35
36
37
# File 'lib/cucumber/file_specs.rb', line 33

def locations
  return [Core::Test::Location.new(@file)] if @lines.empty?

  @lines.map { |line| Core::Test::Location.new(@file, line) }
end