Skip to content

Instantly share code, notes, and snippets.

@jmazzi
Created June 4, 2013 18:06
Show Gist options
  • Save jmazzi/5708105 to your computer and use it in GitHub Desktop.
Save jmazzi/5708105 to your computer and use it in GitHub Desktop.
With a simple rails project `rails g testing -d mysql`, rspec exits with 0 when ActiveRecord encounters method_missing.
# nope.rb
class Nope < ActiveRecord::Base
end
# nope_spec.rb
require 'spec_helper'
describe Nope do
Nope.blah
it "sucks" do
puts "HI THERE"
end
end
-bash-4.1$ rspec; echo $?
/var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `blah' for #<Class:0x00000001295940> (NoMethodError)
from /var/lib/jenkins/lol/hi/spec/models/nope_spec.rb:4:in `block in <top (required)>'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:242:in `module_eval'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:242:in `subclass'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:228:in `describe'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/dsl.rb:18:in `describe'
from /var/lib/jenkins/lol/hi/spec/models/nope_spec.rb:3:in `<top (required)>'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p429@helix_core-0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment