Permalink
Browse files

One feature is passing, at least

  • Loading branch information...
1 parent bf559dc commit ddbe5cccc5c833d36c6d045072684d8e2036947e @qrush qrush committed Jul 20, 2009
@@ -14,7 +14,6 @@ Feature: Grading projects
Then the "_site/index.html" file should exist
And I should see "factory_girl" in "_site/index.html"
And I should see "clearance" in "_site/index.html"
- And I should see "http://metrics.thoughtbot.com" in "_site/index.html"
And the "_site/clearance/output" directory should exist
And the "_site/factory_girl/output" directory should exist
And the template files should exist in "_site"
@@ -31,7 +30,6 @@ Feature: Grading projects
Then the "_site/index.html" file should exist
And I should see "factory_girl" in "_site/index.html"
And I should see "clearance" in "_site/index.html"
- And I should see "http://metrics.thoughtbot.com" in "_site/index.html"
And the "_site/clearance/output" directory should exist
And the "_site/factory_girl/output" directory should exist
And the "_site/private/index.html" file should exist
@@ -1,14 +1,20 @@
+Before do
+ FileUtils.rm_rf(INTEGRITY_DIR)
+ FileUtils.rm_rf(File.join(TEST_DIR, '_site'))
+ FileUtils.rm_rf(File.join(TEST_DIR, 'config.yml'))
+end
+
Given /^I have integrity setup/ do
`integrity install #{INTEGRITY_DIR}`
`integrity migrate_db #{INTEGRITY_CONFIG}`
end
Given /^I have a (private|public) integrity project named "([^\"]*)"$/ do |access, name|
Integrity.new(INTEGRITY_CONFIG)
- project = Integrity::Project.create(:name => name,
- :uri => "git://github.com/thoughtbot/#{name}",
+ project = Integrity::Project.create(:name => name,
+ :uri => "git://github.com/thoughtbot/#{name}",
:public => (access == "public"))
- print project.build
+ project.build
end
Given /^I have a configuration file with "([^\"]*)" set to "([^\"]*)"$/ do |key, value|
@@ -21,29 +27,29 @@
Given /^I have a basic site configuration$/ do
Given %{I have a configuration file with "url" set to "http://metrics.thoughtbot.com"}
And %{I have a configuration file with "integrity_config" set to "integrity/config.yml"}
- And %{I have a configuration file with "site" set to "_site"}
+ And %{I have a configuration file with "site" set to "#{File.expand_path('_site')}"}
end
When /^I run "([^\"]*)"$/ do |command|
- print `#{command} --trace`
+ print `cd #{TEST_DIR}; #{command} --trace`
end
Then /^the "([^\"]*)" file should exist$/ do |name|
- assert File.file?(file)
+ assert File.file?(name)
end
Then /^I should see "([^\"]*)" in "([^\"]*)"$/ do |text, file|
assert_match Regexp.new(text), File.read(file)
end
Then /^the "([^\"]*)" directory should exist$/ do |name|
- assert File.directory?(dir)
+ assert File.directory?(name)
end
Then /^the template files should exist in "([^\"]*)"$/ do |dir|
- Then %{the "_site/buttons.css" file should exist"}
- And %{the "_site/reset.css" file should exist"}
- And %{the "_site/integrity.css" file should exist"}
- And %{the "_site/favicon.ico" file should exist"}
+ Then %{the "#{dir}/buttons.css" file should exist}
+ And %{the "#{dir}/reset.css" file should exist}
+ And %{the "#{dir}/integrity.css" file should exist}
+ And %{the "#{dir}/favicon.ico" file should exist}
end
@@ -1,3 +1,5 @@
+$:.unshift(File.join(File.dirname(__FILE__)), '..', 'lib')
+
require 'test/unit'
require 'report_card'
@@ -8,9 +10,3 @@
World do
include Test::Unit::Assertions
end
-
-After do
- FileUtils.rm_rf(INTEGRITY_DIR)
- FileUtils.rm_rf(File.join(TEST_DIR, '_site'))
- FileUtils.rm_rf(File.join(TEST_DIR, 'config.yml'))
-end
View
@@ -80,7 +80,7 @@ class GraderTest < Test::Unit::TestCase
should "have an announcement message for notification" do
message = @grader.message
assert_match "New metrics", message
- assert_match "#{@config['url']}/#{@project.name}/output", message
+ assert_match "#{@project.name}/output", message
end
should "use _site/:project for output_path" do
@@ -96,7 +96,7 @@ class GraderTest < Test::Unit::TestCase
should "have an announcement message for notification" do
message = @grader.message
assert_match "New metrics", message
- assert_match "#{@config['url']}/private/#{@project.name}/output", message
+ assert_match "private/#{@project.name}/output", message
end
should "use _site/private/:project for output_path" do

0 comments on commit ddbe5cc

Please sign in to comment.