Permalink
Browse files

Clean up features for gem, and make a default rake task that runs both

  • Loading branch information...
1 parent e4a6ddc commit f64e25678ed93a9d9195aa68445170b9586cfd7a @mattwynne mattwynne committed Oct 13, 2010
View
@@ -5,4 +5,9 @@ Bundler::GemHelper.install_tasks
require 'rake'
require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new
+RSpec::Core::RakeTask.new
+
+require 'cucumber/rake/task'
+Cucumber::Rake::Task.new
+
+task :default => [:spec, :cucumber]
View
@@ -0,0 +1 @@
+default: --format progress
View
@@ -4,6 +4,9 @@ Feature: Push
As a Relish user dev
I want a push command
+ Background:
+ Given my API token "1234" is stored
+
Scenario: Specify everything at the command-line
- When I run "relish push --host localhost:80 --project rspec-core --user rspec"
- When it should POST to "http://localhost:80/rspec/rspec-core"
+ When I run relish push --host localhost:1234 --project p
+ When it should POST to "http://localhost:1234/pushes?project_id=p&api_token=1234"
@@ -1,3 +1,7 @@
require 'aruba'
gem_bin_path = File.dirname(__FILE__) + '/../../bin'
-ENV['PATH'] = "#{gem_bin_path}:#{ENV['PATH']}"
+ENV['PATH'] = "#{gem_bin_path}:#{ENV['PATH']}"
+
+When /^I run relish ([^\s]*) (.*)$/ do |command, args|
+ Relish::Command.run(command, args.split(" "))
+end
@@ -2,7 +2,7 @@
FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:any, /.*/, :body => "Faked HTTP response")
-When /^it should POST to "http:\/\/localhost:80([^"]*)"$/ do |path|
- request = FakeWeb.last_request
+When /^it should POST to "http:\/\/localhost:1234([^"]*)"$/ do |path|
+ request = FakeWeb.last_request || raise("Fakeweb did not record a request.")
request.path.should == path
end
@@ -0,0 +1,6 @@
+Given /^my API token "([^"]*)" is stored$/ do |api_token|
+ # yeah! dirty hack
+ Relish::Command::Base.class_eval do
+ define_method(:api_token) { api_token }
+ end
+end
View
@@ -0,0 +1,2 @@
+$:.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'relish/command'

0 comments on commit f64e256

Please sign in to comment.