Move 3rd party CLI out of fixtures

This commit is contained in:
Thomas Reynolds 2012-04-16 15:38:26 -07:00
parent a91bcc8a4c
commit bd9814965e
4 changed files with 17 additions and 8 deletions

View file

@ -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"

View file

@ -1,6 +0,0 @@
class Hello < Thor
desc "hello", "Say hello"
def hello
puts "Hello World"
end
end

View file

@ -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