Class: Flatware::Cucumber::Runtime
- Inherits:
-
Cucumber::Runtime
- Object
- Cucumber::Runtime
- Flatware::Cucumber::Runtime
- Defined in:
- lib/flatware/cucumber/runtime.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#loader ⇒ Object
Returns the value of attribute loader.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#visitor ⇒ Object
readonly
Returns the value of attribute visitor.
Instance Method Summary collapse
- #default_configuration ⇒ Object
-
#initialize(out = StringIO.new, err = out) ⇒ Runtime
constructor
A new instance of Runtime.
- #run(feature_files = [], options = []) ⇒ Object
Constructor Details
#initialize(out = StringIO.new, err = out) ⇒ Runtime
Returns a new instance of Runtime.
9 10 11 12 13 14 15 |
# File 'lib/flatware/cucumber/runtime.rb', line 9 def initialize(out = StringIO.new, err = out) @out = out @err = err super(default_configuration) load_step_definitions @results = Results.new(configuration) end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/flatware/cucumber/runtime.rb', line 6 def configuration @configuration end |
#err ⇒ Object (readonly)
Returns the value of attribute err.
7 8 9 |
# File 'lib/flatware/cucumber/runtime.rb', line 7 def err @err end |
#loader ⇒ Object
Returns the value of attribute loader.
6 7 8 |
# File 'lib/flatware/cucumber/runtime.rb', line 6 def loader @loader end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
7 8 9 |
# File 'lib/flatware/cucumber/runtime.rb', line 7 def out @out end |
#visitor ⇒ Object (readonly)
Returns the value of attribute visitor.
7 8 9 |
# File 'lib/flatware/cucumber/runtime.rb', line 7 def visitor @visitor end |
Instance Method Details
#default_configuration ⇒ Object
17 18 19 20 21 |
# File 'lib/flatware/cucumber/runtime.rb', line 17 def default_configuration config = ::Cucumber::Cli::Configuration.new config.parse! [] config end |
#run(feature_files = [], options = []) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/flatware/cucumber/runtime.rb', line 23 def run(feature_files = [], = []) @loader = nil = [ Array(feature_files), %w[--format Flatware::Cucumber::Formatter], ].reduce(:+) configure(::Cucumber::Cli::Main.new(, out, err).configuration) self.visitor = configuration.build_tree_walker(self) visitor.visit_features(features) results end |