From bd9814965ed8f051246e75e54f64e13a33df1829 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 16 Apr 2012 15:38:26 -0700 Subject: [PATCH] Move 3rd party CLI out of fixtures --- middleman-core/features/3rd_party_cli.feature | 14 ++++++++++++-- .../fixtures/3rd-party-command/config.rb | 0 .../fixtures/3rd-party-command/tasks/hello_task.rb | 6 ------ .../step_definitions/builder_steps.rb | 5 +++++ 4 files changed, 17 insertions(+), 8 deletions(-) delete mode 100644 middleman-core/fixtures/3rd-party-command/config.rb delete mode 100644 middleman-core/fixtures/3rd-party-command/tasks/hello_task.rb diff --git a/middleman-core/features/3rd_party_cli.feature b/middleman-core/features/3rd_party_cli.feature index 297040b5..71e6a009 100644 --- a/middleman-core/features/3rd_party_cli.feature +++ b/middleman-core/features/3rd_party_cli.feature @@ -1,5 +1,15 @@ Feature: Allow config.rb and extensions to add CLI commands - Scenario: Test 3rd Party Command - Given a fixture app "3rd-party-command" + + Scenario: Command autoloaded from tasks/ directory + Given an empty app + And a file named "tasks/hello_task.rb" with: + """ + class Hello < Thor + desc "hello", "Say hello" + def hello + puts "Hello World" + end + end + """ When I run `middleman hello` Then the output should contain "Hello World" \ No newline at end of file diff --git a/middleman-core/fixtures/3rd-party-command/config.rb b/middleman-core/fixtures/3rd-party-command/config.rb deleted file mode 100644 index e69de29b..00000000 diff --git a/middleman-core/fixtures/3rd-party-command/tasks/hello_task.rb b/middleman-core/fixtures/3rd-party-command/tasks/hello_task.rb deleted file mode 100644 index d6d217bb..00000000 --- a/middleman-core/fixtures/3rd-party-command/tasks/hello_task.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Hello < Thor - desc "hello", "Say hello" - def hello - puts "Hello World" - end -end \ No newline at end of file diff --git a/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb b/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb index b6b7b954..c7730cdd 100644 --- a/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb +++ b/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb @@ -7,6 +7,11 @@ Given /^app "([^\"]*)" is using config "([^\"]*)"$/ do |path, config_name| FileUtils.cp(config_path, config_dest) end +Given /^an empty app$/ do + step %Q{a directory named "empty_app"} + step %Q{I cd to "empty_app"} +end + Given /^a fixture app "([^\"]*)"$/ do |path| # This step can be reentered from several places but we don't want # to keep re-copying and re-cd-ing into ever-deeper directories