Permalink
Browse files

First draft at some cucumber features

  • Loading branch information...
1 parent fbcda68 commit b85a5d780e7641dc22e41c92aa4ed8c3b8b4b5ce @qrush qrush committed Jul 13, 2009
Showing with 63 additions and 0 deletions.
  1. +45 −0 features/grading_projects.feature
  2. +17 −0 features/support/env.rb
  3. +1 −0 lib/report_card.rb
View
45 features/grading_projects.feature
@@ -0,0 +1,45 @@
+Feature: Grading projects
+ As a programmer who is concerned about quality
+ I want to be able to find out details metrics about my application
+ In order to improve it and make it awesome
+
+ Scenario: Grading public projects
+ Given I have integrity setup in the "integrity" folder
+ And I have a public integrity project called "factory_girl"
+ And I have a public integrity project called "clearance"
+ And 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"
+
+ When I run "rake grade"
+
+ 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"
+
+ Scenario: Grading public and private projects
+ Given I have integrity setup in the "integrity" folder
+ And I have a public integrity project called "factory_girl"
+ And I have a public integrity project called "clearance"
+ And I have a private integrity project called "paperclip"
+ And 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"
+
+ When I run "rake grade"
+
+ 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
+ And I should see "paperclip" in "_site/private/index.html"
+ And I should see "http://metrics.thoughtbot.com" in "_site/private/index.html"
+ And the "_site/private/paperclip/output" directory should exist
+ And the template files should exist in "_site"
View
17 features/support/env.rb
@@ -0,0 +1,17 @@
+require 'test/unit'
+
+TEST_DIR = File.join('/', 'tmp', 'report_card')
+
+World do
+ include Test::Unit::Assertions
+end
+
+Before do
+ FileUtils.mkdir(TEST_DIR)
+ Dir.chdir(TEST_DIR)
+end
+
+After do
+ Dir.chdir(TEST_DIR)
+ FileUtils.rm_rf(TEST_DIR)
+end
View
1 lib/report_card.rb
@@ -1,5 +1,6 @@
$:.unshift(File.dirname(__FILE__))
+gem 'integrity', '0.1.9.3'
require 'integrity'
require 'metric_fu'
require 'tinder'

0 comments on commit b85a5d7

Please sign in to comment.