Class: ManiokBdd::Cli
- Inherits:
-
Object
- Object
- ManiokBdd::Cli
- Defined in:
- lib/maniok_bdd/cli.rb
Instance Method Summary collapse
- #create_spec_acceptance_folder ⇒ Object
-
#initialize(args) ⇒ Cli
constructor
A new instance of Cli.
- #ruby_file ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Cli
Returns a new instance of Cli.
3 4 5 |
# File 'lib/maniok_bdd/cli.rb', line 3 def initialize(args) @feature_file = args.first end |
Instance Method Details
#create_spec_acceptance_folder ⇒ Object
16 17 18 19 |
# File 'lib/maniok_bdd/cli.rb', line 16 def create_spec_acceptance_folder create_unless_exists "spec" create_unless_exists File.join("spec", "acceptance") end |
#ruby_file ⇒ Object
21 22 23 24 |
# File 'lib/maniok_bdd/cli.rb', line 21 def ruby_file feature_file_basename = File.basename(@feature_file) File.join "spec", "acceptance", "#{feature_file_basename}.rb" end |
#run ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/maniok_bdd/cli.rb', line 7 def run gherkin_formatter = ManiokBdd::GherkinFormatter.build @feature_file create_spec_acceptance_folder write_file ruby_file, gherkin_formatter.to_s 0 # success:) end |