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
#!/usr/bin/env ruby | |
CUCUMBER_PORT = 8990 | |
RSPEC_PORT = 8989 | |
def running?(port) | |
`netstat -an` =~ /\b#{port}\b/m | |
end | |
START_CUCUMBER = "spork cuc -p #{CUCUMBER_PORT}" |
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
activesupport (3.0.6) lib/active_support/whiny_nil.rb:48:in `method_missing' | |
actionpack (3.0.6) lib/action_view/render/rendering.rb:25:in `render' | |
haml (3.0.25) lib/haml/helpers/action_view_mods.rb:11:in `block in render_with_haml' | |
haml (3.0.25) lib/haml/helpers.rb:90:in `non_haml' | |
haml (3.0.25) lib/haml/helpers/action_view_mods.rb:11:in `render_with_haml' | |
app/views/users/index.html.haml:3:in `_app_views_users_index_html_haml___3430179667211235058_2156490900_627369316816662806' | |
actionpack (3.0.6) lib/action_view/template.rb:135:in `block in render' | |
activesupport (3.0.6) lib/active_support/notifications.rb:54:in `instrument' | |
actionpack (3.0.6) lib/action_view/template.rb:127:in `render' | |
actionpack (3.0.6) lib/action_view/render/rendering.rb:59:in `block in _render_template' |
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
Feature: Widgets | |
Scenario: More than one page of widgets | |
* there are 25 widgets | |
* go to the widgets page | |
* only the latest 20 widgets should be visible | |
* go to the next page | |
* only the first 5 widgets should be visible | |
# vs. |
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
# Tasks for capistrano | |
def bundler_rake(task_name) | |
task task_name, :roles => [:app] do | |
run "cd #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} #{task_name}", :env => {'RAILS_ENV' => rails_env} | |
end | |
end | |
desc "Start Solr" | |
bundler_rake "solr:start" |
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
God.watch do |w| | |
DEFAULT.call(w) | |
w.name = "delayed_job" | |
w.start = "bundle exec #{RAILS_ROOT}/script/delayed_job -e #{RAILS_ENV} run" | |
w.pid_file = "#{RAILS_ROOT}/tmp/pids/delayed_job.pid" | |
end |
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
ruby-1.9.2@fuubar fuubar develop / $ rspec spec | |
FFFFFFFFFFFFFFFFFFF | |
Failures: | |
1) Fuubar start should create a new ProgressBar | |
Failure/Error: @output = StringIO.new | |
uninitialized constant RSpec::Core::ExampleGroup::Nested_1::Nested_1::StringIO | |
# ./spec/fuubar_spec.rb:6:in `block (2 levels) in <top (required)>' | |
2) Fuubar start should set the title |
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
module ValidationMatcher | |
class Validate | |
include RSpec::Matchers::Pretty | |
attr_accessor :attribute, :values, :target, :results, :value_description | |
def initialize(attribute) | |
self.attribute = attribute | |
end |
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
ActiveRecord::StatementInvalid (Mysql2::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like': SELECT `tags`.* FROM `tags` WHERE (name LIKE '☃')): |
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
module RSpec | |
module Expectations | |
# If Test::Unit is loaed, we'll use its error as baseclass, so that Test::Unit | |
# will report unmet RSpec expectations as failures rather than errors. | |
superclass = ['Test::Unit::AssertionFailedError', '::StandardError'].map do |c| | |
eval(c) rescue nil | |
end.compact.first | |
class ExpectationNotMetError < superclass | |
def spec_failure? |
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
Rake.application.instance_variable_get('@tasks')['default'].prerequisites.delete('test') | |
task :default => :spec | |
task :stats => "spec:statsetup" | |
desc "Run all specs in spec directory (excluding plugin specs)" | |
task :spec => :"spec:load" do | |
RSpec.run(:all) # or something similar | |
end |