Class: CucumberMonitor::Base
- Inherits:
-
Object
- Object
- CucumberMonitor::Base
- Defined in:
- lib/cucumber_monitor/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #features ⇒ Object
- #files ⇒ Object
- #locate ⇒ Object
- #search(criteria) ⇒ Object
- #search_and_include_features(dir_entries, collection = []) ⇒ Object
Class Method Details
.cucumber_output_file ⇒ Object
14 15 16 |
# File 'lib/cucumber_monitor/base.rb', line 14 def self.cucumber_output_file "#{path}/tmp/cucumber.out" end |
.features_path ⇒ Object
10 11 12 |
# File 'lib/cucumber_monitor/base.rb', line 10 def self.features_path "#{path}/features" end |
.path ⇒ Object
6 7 8 |
# File 'lib/cucumber_monitor/base.rb', line 6 def self.path CucumberMonitor.path end |
Instance Method Details
#features ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/cucumber_monitor/base.rb', line 37 def features collection = [] files.each do |file| collection << CucumberMonitor::FeatureFile.new(file) end collection end |
#files ⇒ Object
22 23 24 25 26 |
# File 'lib/cucumber_monitor/base.rb', line 22 def files collection = [] dir_entries = Dir.entries(self.class.features_path) search_and_include_features(dir_entries) end |
#locate ⇒ Object
18 19 20 |
# File 'lib/cucumber_monitor/base.rb', line 18 def locate "Printing: #{I18n.t("feature")}" end |
#search(criteria) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cucumber_monitor/base.rb', line 45 def search(criteria) results = [] features.each do |feature| feature.scenarios.each do |scenario| scenario.steps.each do |step| results << step if step.description.include?(criteria) end end end results end |
#search_and_include_features(dir_entries, collection = []) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/cucumber_monitor/base.rb', line 28 def search_and_include_features(dir_entries, collection=[]) dir_entries.each do |entrie| if entrie.include?('.feature') collection << entrie end end collection end |