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.
36 37 38 39 40 41 42 43 44 |
# File 'lib/gurke/feature.rb', line 36 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.
28 29 30 |
# File 'lib/gurke/feature.rb', line 28 def backgrounds @backgrounds end |
#file ⇒ String (readonly)
Return path to file containing this feature.
10 11 12 |
# File 'lib/gurke/feature.rb', line 10 def file @file end |
#line ⇒ Fixnum (readonly)
Return line number where this feature is defined.
16 17 18 |
# File 'lib/gurke/feature.rb', line 16 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.
33 34 35 |
# File 'lib/gurke/feature.rb', line 33 def raw @raw end |
#scenarios ⇒ Array<Scenario> (readonly)
List of scenarios this feature specifies.
22 23 24 |
# File 'lib/gurke/feature.rb', line 22 def scenarios @scenarios end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
30 31 32 |
# File 'lib/gurke/feature.rb', line 30 def @tags end |
Class Method Details
.new(*args) ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/gurke/feature.rb', line 66 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
54 55 56 |
# File 'lib/gurke/feature.rb', line 54 def description raw.description end |
#failed? ⇒ Boolean
58 59 60 |
# File 'lib/gurke/feature.rb', line 58 def failed? scenarios.any?(&:failed?) end |
#name ⇒ String
Return name of this feature.
50 51 52 |
# File 'lib/gurke/feature.rb', line 50 def name raw.name end |
#pending? ⇒ Boolean
62 63 64 |
# File 'lib/gurke/feature.rb', line 62 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.
77 78 79 80 81 82 83 84 85 |
# File 'lib/gurke/feature.rb', line 77 def run(runner, reporter) reporter.invoke :before_feature, self runner.hook :feature, self, nil do run_feature runner, reporter end ensure reporter.invoke :after_feature, self end |