Skip to content
Browse files

got something working with running capybara tests alongside aruba tests.

  • Loading branch information...
1 parent ac865d5 commit 261d8525e087c15ddb23ad6fcc24bb2482c1d27f @botandrose botandrose committed Oct 19, 2012
View
8 features/spar.feature → features/cli.feature
@@ -1,7 +1,7 @@
-Feature: Spar
- In order to generate a new spar app
- As a CLI
- I want to generate a bunch of files
+Feature: spar new
+ In order to get started on a new spar app
+ As a developer
+ I want to generate a project skeleton
Scenario: Creating a new app
When I run `spar new test_app`
View
10 features/server.feature
@@ -0,0 +1,10 @@
+Feature: Rack app that compiles on the fly
+ In order to develop my app locally
+ As a developer
+ I want to run spar as a rack server
+
+ Scenario: Serves haml files under /pages
+ Given a dummy app
+ When I visit "/index.html"
+ Then I should see "Welcome to your new Spar app."
+
View
17 features/step_definitions/dummy_app_steps.rb
@@ -0,0 +1,17 @@
+Given /^a dummy app$/ do
+ Dir.chdir "tmp" do
+ `rm -rf dummy && spar new dummy`
+ Dir.chdir "dummy" do
+ Capybara.app = Spar.app
+ Spar.settings["environment"] = "test"
+ end
+ end
+end
+
+When /^I visit "(.*?)"$/ do |path|
+ visit path
+end
+
+Then /^I should see "(.*?)"$/ do |text|
+ page.should have_content(text)
+end
View
9 features/support/env.rb
@@ -0,0 +1,9 @@
+require 'cucumber'
+
+require 'aruba/cucumber'
+
+require 'capybara'
+require 'capybara/cucumber'
+require 'capybara/session'
+
+require "spar"
View
1 features/support/setup.rb
@@ -1 +0,0 @@
-require 'aruba/cucumber'
View
1 spar.gemspec
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.executables = ["spar"]
s.add_development_dependency "cucumber"
+ s.add_development_dependency "capybara"
s.add_development_dependency "aruba"
s.add_dependency "rack", '~> 1.4', '>= 1.4.1'

0 comments on commit 261d852

Please sign in to comment.
Something went wrong with that request. Please try again.