Class: Gurke::Feature
- Inherits:
-
Object
- Object
- Gurke::Feature
- Defined in:
- lib/gurke/feature.rb
Instance Attribute Summary collapse
-
#backgrounds ⇒ Array<Background>
readonly
List of backgrounds this feature specifies.
-
#file ⇒ String
readonly
Return path to file containing this feature.
-
#line ⇒ Fixnum
readonly
Return line number where this feature is defined.
- #raw ⇒ Object readonly private
-
#scenarios ⇒ Array<Scenario>
readonly
List of scenarios this feature specifies.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Class Method Summary collapse
Instance Method Summary collapse
- #description ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(file, line, tags, raw) ⇒ Feature
constructor
private
A new instance of Feature.
-
#name ⇒ String
Return name of this feature.
- #pending? ⇒ Boolean
- #run(runner, reporter) ⇒ Object private
Constructor Details
#initialize(file, line, tags, raw) ⇒ Feature
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.
Returns a new instance of Feature.
34 35 36 37 38 39 40 41 42 |
# File 'lib/gurke/feature.rb', line 34 def initialize(file, line, , raw) @scenarios = RunList.new @backgrounds = RunList.new @file = file @line = line @tags = @raw = raw end |
Instance Attribute Details
#backgrounds ⇒ Array<Background> (readonly)
List of backgrounds this feature specifies.
26 27 28 |
# File 'lib/gurke/feature.rb', line 26 def backgrounds @backgrounds end |
#file ⇒ String (readonly)
Return path to file containing this feature.
8 9 10 |
# File 'lib/gurke/feature.rb', line 8 def file @file end |
#line ⇒ Fixnum (readonly)
Return line number where this feature is defined.
14 15 16 |
# File 'lib/gurke/feature.rb', line 14 def line @line end |
#raw ⇒ Object (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.
31 32 33 |
# File 'lib/gurke/feature.rb', line 31 def raw @raw end |
#scenarios ⇒ Array<Scenario> (readonly)
List of scenarios this feature specifies.
20 21 22 |
# File 'lib/gurke/feature.rb', line 20 def scenarios @scenarios end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
28 29 30 |
# File 'lib/gurke/feature.rb', line 28 def @tags end |
Class Method Details
.new(*args) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/gurke/feature.rb', line 68 def self.new(*args) if args.size == 1 && (f = args.first).is_a?(self) super f.file, f.line, f., f.raw else super end end |
Instance Method Details
#description ⇒ Object
48 49 50 |
# File 'lib/gurke/feature.rb', line 48 def description raw.description end |
#failed? ⇒ Boolean
60 61 62 |
# File 'lib/gurke/feature.rb', line 60 def failed? scenarios.any?(&:failed?) end |
#name ⇒ String
Return name of this feature.
56 57 58 |
# File 'lib/gurke/feature.rb', line 56 def name raw.name end |
#pending? ⇒ Boolean
64 65 66 |
# File 'lib/gurke/feature.rb', line 64 def pending? scenarios.any?(&:pending?) end |
#run(runner, reporter) ⇒ Object
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.
79 80 81 82 83 84 85 86 87 |
# File 'lib/gurke/feature.rb', line 79 def run(runner, reporter) reporter.invoke :before_feature, self runner.hook :feature, nil do run_feature runner, reporter end ensure reporter.invoke :after_feature end |