Skip to content

Instantly share code, notes, and snippets.

View caifara's full-sized avatar

Ivo Dancet caifara

View GitHub Profile
#!/usr/bin/env rvm-shell
bundle install --no-color
#!/bin/bash -x
cp config/database.ci.yml config/database.yml
@caifara
caifara / hudson.rake
Created November 6, 2010 10:40
lib/tasks/hudson.rake
# most of this came from: http://reprocessed.org/blog/easy_rails_ci_with_hudson
namespace :hudson do
def report_path
"hudson/reports/features/"
end
Cucumber::Rake::Task.new({'cucumber' => [:report_setup]}) do |t|
t.cucumber_opts = %{--format junit --out #{report_path}}
t.rcov = true
# Usage in console:
# app.rinfo => list of all route helper methods (ending on path without the
# hash_for methods)
# app.rinfo "user" => same list, but only routes containing "user".
# app.rinfo "user", "edit" => same list, but only routes containing "user"
# and "edit".
class ActionDispatch::Integration::Session
def rinfo(*parts)
methods = self.methods.select { |m| m =~ /.*_path$/ && m[0..3] != "hash" }
config.include Webrat::HaveTagMatcher
config.include Haml::Helpers
config.include ActionView::Helpers
config.before(:each) do
init_haml_helpers
end
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails/world'
require 'webrat'
require 'cucumber/rails/rspec'