module Cucumber::CompatibilityKit
Public Class Methods
all_examples()
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 5 def all_examples gherkin_examples + markdown_examples end
example_path(example_name)
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 37 def example_path(example_name) path = File.join(examples_path, example_name) return path if File.directory?(path) raise ArgumentError.new end
examples_path()
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 33 def examples_path File.expand_path("#{File.dirname(__FILE__)}/../features/") end
gherkin_examples()
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 9 def gherkin_examples Dir .entries(examples_path) .select do |file| folder = File.join(examples_path, file) file != '.' && file != '..' && File.directory?(folder) && is_gherkin_example?(folder) end end
markdown_examples()
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 21 def markdown_examples Dir .entries(examples_path) .select do |file| folder = File.join(examples_path, file) file != '.' && file != '..' && File.directory?(folder) && is_markdown_example?(folder) end end
Private Class Methods
is_gherkin_example?(example_folder)
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 47 def is_gherkin_example?(example_folder) Dir.entries(example_folder).select { |file| File.extname(file) == '.feature' }.count > 0 end
is_markdown_example?(example_folder)
click to toggle source
# File lib/cucumber-compatibility-kit.rb, line 51 def is_markdown_example?(example_folder) Dir.entries(example_folder).select { |file| File.extname(file) == '.md' }.count > 0 end