Class: Cucumber::FileSpecs::FileSpec
- Inherits:
-
Object
- Object
- Cucumber::FileSpecs::FileSpec
- Defined in:
- lib/cucumber/file_specs.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(s) ⇒ FileSpec
constructor
A new instance of FileSpec.
- #locations ⇒ Object
Constructor Details
#initialize(s) ⇒ FileSpec
Returns a new instance of FileSpec.
24 25 26 27 28 |
# File 'lib/cucumber/file_specs.rb', line 24 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
#file ⇒ Object (readonly)
Returns the value of attribute file.
30 31 32 |
# File 'lib/cucumber/file_specs.rb', line 30 def file @file end |
Instance Method Details
#locations ⇒ Object
32 33 34 35 |
# File 'lib/cucumber/file_specs.rb', line 32 def locations return [ Core::Ast::Location.new(@file) ] if @lines.empty? @lines.map { |line| Core::Ast::Location.new(@file, line) } end |