From 9387ba7efb2f4b61002072b50fb67c4d70ae0290 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 30 May 2010 12:37:12 -0700 Subject: [PATCH] Fix some tests around listing projects. --- features/command_line.feature | 1 + features/extensions.feature | 6 ++++-- features/step_definitions/extension_steps.rb | 11 ++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/features/command_line.feature b/features/command_line.feature index 86552d66..95a957ed 100644 --- a/features/command_line.feature +++ b/features/command_line.feature @@ -268,6 +268,7 @@ Feature: Command Line | sass/utilities.scss | 2 | 0 | 0 | 2 | 5 | 11 | | Total.* | 44 | 9 | 0 | 45 | 299 | 832 | + @listframeworks Scenario: List frameworks registered with compass When I run: compass frameworks Then I should see the following lines of output: diff --git a/features/extensions.feature b/features/extensions.feature index 34c8c1e8..eaed66fb 100644 --- a/features/extensions.feature +++ b/features/extensions.feature @@ -4,17 +4,19 @@ Feature: Extensions I can install extensions that others have created And I can create and publish my own extensions + @listframeworks Scenario: Extensions directory for stand_alone projects Given I am using the existing project in test/fixtures/stylesheets/compass And the "extensions" directory exists And and I have a fake extension at extensions/testing - When I run: compass --list-frameworks + When I run: compass frameworks Then the list of frameworks includes "testing" + @listframeworks Scenario: Extensions directory for rails projects Given I'm in a newly created rails project: my_rails_project And the "my_rails_project/vendor/plugins/compass/extensions" directory exists And and I have a fake extension at my_rails_project/vendor/plugins/compass/extensions/testing - When I run: compass --list-frameworks + When I run: compass frameworks Then the list of frameworks includes "testing" diff --git a/features/step_definitions/extension_steps.rb b/features/step_definitions/extension_steps.rb index f6216c1e..2423e482 100644 --- a/features/step_definitions/extension_steps.rb +++ b/features/step_definitions/extension_steps.rb @@ -5,9 +5,18 @@ end Given /^and I have a fake extension at (.*)$/ do |directory| FileUtils.mkdir_p File.join(directory, 'stylesheets') FileUtils.mkdir_p File.join(directory, 'templates/project') + open(File.join(directory, 'templates/project/manifest.rb'),"w") do |f| + f.puts %Q{ + description "This is a fake extension" + + help "this is the fake help" + + welcome_message "this is a fake welcome" + } + end end Then /^the list of frameworks includes "([^\"]*)"$/ do |framework| - @last_result.split("\n").map{|f| f.strip}.should include(framework) + @last_result.split("\n").map{|f| f.gsub(/(^\s+[*-]\s+)|(\s+$)/,'')}.should include(framework) end