Skip to content
Browse files

STEAK!!!!

  • Loading branch information...
1 parent 3f9e487 commit da9bba3165be206c4d593f166e8f57eb7a122e04 Robert Fletcher + Tom Uebel committed Dec 13, 2012
View
7 Gemfile
@@ -25,7 +25,7 @@ group :test do
gem 'pickle', "0.3.4"
gem 'factory_girl', "1.3.3"
gem 'object_daddy', "0.4.3"
- gem 'capybara-webkit'
+ #gem 'capybara-webkit'
gem 'fakeweb'
end
@@ -40,3 +40,8 @@ group :development do
gem 'ruby2ruby', '1.2.2'
gem 'heckle'
end
+
+group :development, :test do
+ gem 'capybara'
+ gem 'steak'
+end
View
9 Gemfile.lock
@@ -39,9 +39,6 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
- capybara-webkit (0.12.1)
- capybara (>= 1.0.0, < 1.2)
- json
childprocess (0.3.5)
ffi (~> 1.0, >= 1.0.6)
columnize (0.3.6)
@@ -68,7 +65,6 @@ GEM
ParseTree (>= 2.0.0)
ZenTest (>= 3.5.2)
ruby2ruby (>= 1.1.6)
- json (1.7.5)
json_pure (1.7.5)
libwebsocket (0.1.5)
addressable
@@ -132,6 +128,8 @@ GEM
sqlite3 (1.3.6)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
+ steak (1.1.0)
+ rspec (>= 1.3)
sys-proctable (0.9.1)
thor (0.16.0)
webrat (0.7.3)
@@ -148,7 +146,7 @@ PLATFORMS
DEPENDENCIES
SystemTimer (= 1.2.2)
- capybara-webkit
+ capybara
comma!
factory_girl (= 1.3.3)
fakeweb
@@ -176,5 +174,6 @@ DEPENDENCIES
shoulda
spork (= 0.8.5)
sqlite3-ruby
+ steak
webrat (= 0.7.3)
will_paginate (= 2.3.15)
View
44 lib/tasks/steak.rake
@@ -0,0 +1,44 @@
+unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
+
+begin
+ require 'spec/rake/spectask'
+rescue MissingSourceFile
+ module Spec
+ module Rake
+ class SpecTask
+ def initialize(name)
+ task name do
+ # if rspec-rails is a configured gem, this will output helpful material and exit ...
+ require File.expand_path(File.join(File.dirname(__FILE__),"..","..","config","environment"))
+
+ # ... otherwise, do this:
+ raise <<-MSG
+
+#{"*" * 80}
+* You are trying to run an rspec rake task defined in
+* #{__FILE__},
+* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
+#{"*" * 80}
+MSG
+ end
+ end
+ end
+ end
+ end
+end
+
+namespace :spec do
+ desc "Run the code examples in spec/acceptance"
+ Spec::Rake::SpecTask.new(:acceptance => "db:test:prepare") do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/acceptance/**/*_spec.rb"]
+ end
+
+ # Setup stats to include acceptance specs
+ task :statsetup do
+ require 'code_statistics'
+ ::STATS_DIRECTORIES << %w(Acceptance\ specs spec/acceptance) if File.exist?('spec/acceptance')
+ ::CodeStatistics::TEST_TYPES << "Acceptance specs" if File.exist?('spec/acceptance')
+ end
+end
+end
View
10 spec/acceptance/acceptance_helper.rb
@@ -0,0 +1,10 @@
+require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
+require "steak"
+require 'capybara/rails'
+
+Spec::Runner.configure do |config|
+ config.include Capybara
+end
+
+# Put your acceptance spec helpers inside /spec/acceptance/support
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
View
5 spec/acceptance/support/helpers.rb
@@ -0,0 +1,5 @@
+module HelperMethods
+ # Put helper methods you need to be available in all tests here.
+end
+
+Spec::Runner.configuration.include(HelperMethods)
View
9 spec/acceptance/support/paths.rb
@@ -0,0 +1,9 @@
+module NavigationHelpers
+ # Put helper methods related to the paths in your application here.
+
+ def homepage
+ "/"
+ end
+end
+
+Spec::Runner.configuration.include(NavigationHelpers)

0 comments on commit da9bba3

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