Skip to content

Commit

Permalink
Merge pull request #20 from vitorbaptista/1ff2498ccd25e6b2c2776cc5f86…
Browse files Browse the repository at this point in the history
…4deae4451fe2e

Upgrading gems so we're able to install in Ubuntu 12.04 without modifications (now with Cucumber!)
  • Loading branch information
lukebaker committed Aug 16, 2012
2 parents 5d4dda2 + 1ff2498 commit 07e3a0e
Show file tree
Hide file tree
Showing 49 changed files with 306 additions and 244 deletions.
21 changes: 12 additions & 9 deletions Gemfile
@@ -1,28 +1,28 @@
source :rubygems
source "http://gems.github.com"

gem "bundler", "1.0.21"
gem "rake", "~> 0.9.2.2"
gem "rdoc", "~> 3.12"
gem "bundler", "~> 1.1.5"
gem "rails", "2.3.14"
gem "hoptoad_notifier", "2.4.9"
gem "ambethia-smtp-tls", "1.1.2", :require => "smtp-tls"
gem "thoughtbot-paperclip", "2.3.1",
:require => "paperclip"
gem "paperclip", "2.3.1"
gem "mime-types", "1.16",
:require => "mime/types"
gem "xml-simple", "1.0.12",
:require => "xmlsimple"
gem "yfactorial-utility_scopes", "0.2.2",
:require => "utility_scopes"
gem "justinfrench-formtastic", "0.2.2",
:require => "formtastic"
gem "formtastic", "~> 0.2.2"
gem "inherited_resources", "1.0.4"
gem "has_scope", "0.4.2"
gem "responders", "0.4.8"
gem "thoughtbot-clearance", "0.8.2",
:require => "clearance"
gem "fastercsv", "1.5.1"
gem "delayed_job", "2.0.6"
gem "redis", "1.0.7"
gem "redis", "~> 3.0.1"
gem "newrelic_rpm", "3.3.0"

gem "sendgrid", "0.1.4"
Expand All @@ -32,20 +32,23 @@ gem 'mysql2', '0.2.18'


group :cucumber do
gem 'cucumber', '0.8.5'
gem 'cucumber', '1.1.0'
gem 'cucumber-rails', '0.3.2'
gem 'webrat', "0.5.3"
gem 'fakeweb', '1.2.5'
gem 'factory_girl', '1.2.3'
end

group :test do
gem "rspec", "~>1.3.1"
gem "rspec-rails", "1.3.4"
gem "factory_girl", "1.2.3"
gem "shoulda", "~>2.10.1"
gem "jtrupiano-timecop", "0.2.1",
:require => "timecop"
gem "fakeweb", "1.2.5"
gem "jferris-mocha", "0.9.5.0.1241126838",
:require => "mocha"
end

group :test, :cucumber do
gem 'factory_girl', '1.2.3'
end
47 changes: 27 additions & 20 deletions Gemfile.lock
Expand Up @@ -13,22 +13,25 @@ GEM
activesupport (= 2.3.14)
activesupport (2.3.14)
ambethia-smtp-tls (1.1.2)
builder (2.1.2)
cucumber (0.8.5)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.1.4)
json_pure (~> 1.4.3)
term-ansicolor (~> 1.0.4)
daemons (1.1.8)
builder (3.0.0)
cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.5.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (0.3.2)
cucumber (>= 0.8.0)
daemons (1.1.9)
delayed_job (2.0.6)
daemons
diff-lcs (1.1.3)
factory_girl (1.2.3)
fakeweb (1.2.5)
fastercsv (1.5.1)
gherkin (2.1.5)
trollop (~> 1.16.2)
formtastic (0.2.5)
gherkin (2.5.4)
json (>= 1.4.6)
has_scope (0.4.2)
hoptoad_notifier (2.4.9)
activesupport
Expand All @@ -38,13 +41,14 @@ GEM
responders (~> 0.4.3)
jferris-mocha (0.9.5.0.1241126838)
rake
json (1.7.4)
json_pure (1.4.6)
jtrupiano-timecop (0.2.1)
justinfrench-formtastic (0.2.2)
mime-types (1.16)
mysql2 (0.2.18)
newrelic_rpm (3.3.0)
nokogiri (1.5.0)
nokogiri (1.5.5)
paperclip (2.3.1)
rack (1.1.3)
rails (2.3.14)
actionmailer (= 2.3.14)
Expand All @@ -54,7 +58,9 @@ GEM
activesupport (= 2.3.14)
rake (>= 0.8.3)
rake (0.9.2.2)
redis (1.0.7)
rdoc (3.12)
json (~> 1.4)
redis (3.0.1)
responders (0.4.8)
rspec (1.3.2)
rspec-rails (1.3.4)
Expand All @@ -67,8 +73,6 @@ GEM
shoulda (2.10.3)
term-ansicolor (1.0.7)
thoughtbot-clearance (0.8.2)
thoughtbot-paperclip (2.3.1)
trollop (1.16.2)
webrat (0.5.3)
nokogiri (>= 1.2.0)
rack (>= 1.0)
Expand All @@ -81,32 +85,35 @@ PLATFORMS

DEPENDENCIES
ambethia-smtp-tls (= 1.1.2)
bundler (= 1.0.21)
cucumber (= 0.8.5)
bundler (~> 1.1.5)
cucumber (= 1.1.0)
cucumber-rails (= 0.3.2)
delayed_job (= 2.0.6)
factory_girl (= 1.2.3)
fakeweb (= 1.2.5)
fastercsv (= 1.5.1)
formtastic (~> 0.2.2)
has_scope (= 0.4.2)
hoptoad_notifier (= 2.4.9)
inherited_resources (= 1.0.4)
jferris-mocha (= 0.9.5.0.1241126838)
json_pure (= 1.4.6)
jtrupiano-timecop (= 0.2.1)
justinfrench-formtastic (= 0.2.2)
mime-types (= 1.16)
mysql2 (= 0.2.18)
newrelic_rpm (= 3.3.0)
paperclip (= 2.3.1)
rails (= 2.3.14)
redis (= 1.0.7)
rake (~> 0.9.2.2)
rdoc (~> 3.12)
redis (~> 3.0.1)
responders (= 0.4.8)
rspec (~> 1.3.1)
rspec-rails (= 1.3.4)
rubaidh-google_analytics (= 1.1.4)
sendgrid (= 0.1.4)
shoulda (~> 2.10.1)
thoughtbot-clearance (= 0.8.2)
thoughtbot-paperclip (= 2.3.1)
webrat (= 0.5.3)
xml-simple (= 1.0.12)
yfactorial-utility_scopes (= 0.2.2)
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -5,7 +5,7 @@ require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rdoc/task'

require 'tasks/rails'

Expand Down
8 changes: 8 additions & 0 deletions config/cucumber.yml
@@ -0,0 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
8 changes: 4 additions & 4 deletions config/environments/cucumber.rb
@@ -1,8 +1,10 @@
# IMPORTANT: This file was generated by Cucumber 0.4.2
# Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.

config.cache_classes = true # This must be true for Cucumber to operate correctly!
# IMPORTANT: Setting config.cache_classes to false is known to
# break Cucumber's use_transactional_fixtures method.
# For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165
config.cache_classes = true

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
Expand All @@ -19,9 +21,7 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test


HOST = "localhost"
AUTHORIZE_NET_API_LOGIN_ID = ''
AUTHORIZE_NET_TRANSACTION_KEY = ''
ActiveMerchant::Billing::Base.gateway_mode = :test

33 changes: 0 additions & 33 deletions features/step_definitions/factory_girl_steps.rb

This file was deleted.

72 changes: 39 additions & 33 deletions features/support/env.rb
@@ -1,25 +1,26 @@
# IMPORTANT: This file was generated by Cucumber 0.4.2
# Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.
# Consider adding your own code to a new file instead of editing this one.
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.

# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')

require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/rspec'
require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
require 'cucumber/web/tableish'

require 'webrat'
require 'webrat/core/matchers'

Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end

# If you set this to true, each scenario will run in a database transaction.
# You can still turn off transactions on a per-scenario basis, simply tagging
# a feature or scenario with the @no-txn tag.
#
# If you set this to false, transactions will be off for all scenarios,
# regardless of whether you use @no-txn or not.
#
# Beware that turning transactions off will leave data in your database
# after each scenario, which can lead to hard-to-debug failures in
# subsequent scenarios. If you do this, we recommend you create a Before
# block that will explicitly put your database in a known state.
Cucumber::Rails::World.use_transactional_fixtures = true

# If you set this to false, any error raised from within your app will bubble
# up to your step definition and out to cucumber unless you catch it somewhere
Expand All @@ -32,20 +33,25 @@
# of your scenarios, as this makes it hard to discover errors in your application.
ActionController::Base.allow_rescue = false

require 'cucumber'
# Comment out the next line if you don't want Cucumber Unicode support
require 'cucumber/formatter/unicode'
require 'cucumber/webrat/element_locator' # Lets you do table.diff!(element_at('#my_table_or_dl_or_ul_or_ol').to_table)

require 'webrat'
require 'webrat/core/matchers'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
# If you set this to true, each scenario will run in a database transaction.
# You can still turn off transactions on a per-scenario basis, simply tagging
# a feature or scenario with the @no-txn tag. If you are using Capybara,
# tagging with @culerity or @javascript will also turn transactions off.
#
# If you set this to false, transactions will be off for all scenarios,
# regardless of whether you use @no-txn or not.
#
# Beware that turning transactions off will leave data in your database
# after each scenario, which can lead to hard-to-debug failures in
# subsequent scenarios. If you do this, we recommend you create a Before
# block that will explicitly put your database in a known state.
Cucumber::Rails::World.use_transactional_fixtures = true
# How to clean your database when transactions are turned off. See
# http://github.com/bmabey/database_cleaner for more info.
if defined?(ActiveRecord::Base)
begin
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
rescue LoadError => ignore_if_database_cleaner_not_present
end
end

require 'factory_girl/step_definitions'
FakeWeb.allow_net_connect = false

Dir[File.join(Rails.root, "test", "support", "**", "*.rb")].each { |file| require(file) }

51 changes: 44 additions & 7 deletions lib/tasks/cucumber.rake
@@ -1,16 +1,53 @@
$LOAD_PATH.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib') if File.directory?(RAILS_ROOT + '/vendor/plugins/cucumber/lib')
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.


unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks

vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?

begin
require 'cucumber/rake/task'

Cucumber::Rake::Task.new(:features) do |t|
t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
namespace :cucumber do
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
end

Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'wip'
end

Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'rerun'
end

desc 'Run all features'
task :all => [:ok, :wip]
end
desc 'Alias for cucumber:ok'
task :cucumber => 'cucumber:ok'

task :default => :cucumber

task :features => :cucumber do
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
end
task :features => 'db:test:prepare'
rescue LoadError
desc 'Cucumber rake task not available'
task :features do
desc 'cucumber rake task not available (cucumber not installed)'
task :cucumber do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end

end

0 comments on commit 07e3a0e

Please sign in to comment.