This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
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 = "--require features --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" | |
%> | |
default: <%= std_opts %> features | |
wip: --tags @wip:3 --wip features | |
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip | |
autotest: <%= std_opts %> --color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/support/capybara.rb | |
Capybara.server_port = 54321 + ENV.fetch('TDDIUM_TID', 0).to_i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
if Rails.env.production? | |
# production setup stuff | |
elsif Rails.env.test? | |
if ENV['TDDIUM'] | |
config.storage = :file | |
config.root = Dir.tmpdir | |
config.cache_dir = "carrierwave" | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/km.rb | |
require 'tmpdir' | |
KM.init(YOUR_API_KEY, :log_dir => File.join(Dir.tmpdir, "km_log")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/environments/test.rb | |
require 'tmpdir' | |
config.cache_store = :file_store, File.join(Dir.tmpdir, "rails_cache") if ENV['TDDIUM'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/omniauth.rb | |
require 'openid/store/filesystem' | |
use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new(Dir.tmpdir) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# features/step_definitions/web_steps.rb | |
# This replacement step works around an incompatibility between capybara-0.3.9 (or thereabouts) and selenium-webdriver >=2.5.0. | |
When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| | |
with_scope(selector) do | |
# See https://github.com/jnicklas/capybara/issues/88 | |
# page.find_by_id(field).select(value) | |
if Capybara.current_session.mode == :selenium | |
select_node = page.find_by_id(field) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# features/support/selenium_patch.rb | |
# This patch attempts to fix a race condition in the selenium web driver | |
# Reference: https://code.google.com/p/selenium/issues/detail?id=2099 | |
class Capybara::Selenium::Driver | |
def find(selector) | |
begin | |
browser.find_elements(:xpath, selector).map { |node| Capybara::Selenium::Node.new(self, node) } | |
rescue Selenium::WebDriver::Error::UnhandledError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/tddium.yml | |
:tddium: | |
:sqlite: true | |
:mysql: false | |
:mysqlsuper: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/tddium.yml | |
:tddium: | |
:pgsuper: true |