Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2016 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/fbf16511cf6ea6f25e5feef5606d7221 to your computer and use it in GitHub Desktop.
Save anonymous/fbf16511cf6ea6f25e5feef5606d7221 to your computer and use it in GitHub Desktop.
require 'test_helper'
class AlertsControllerTest < ActiveSupport::TestCase
def self.foo(p)
context "whatever" do
should "do things" do
assert_equal 1,1
assert true
p.call
end
end
end
foo(Proc.new{ assert true } )
end
-------
Above line numbers match -- this is blowing up on 'p.call' not the two assertions immediately above it.
1) Error:
AlertsControllerTest#test_: whatever should do things. :
NoMethodError: undefined method `assert' for AlertsControllerTest:Class
test/controllers/alerts_controller_test.rb:15:in `block in <class:AlertsControllerTest>'
test/controllers/alerts_controller_test.rb:10:in `block (2 levels) in foo'
1 runs, 2 assertions, 0 failures, 1 errors, 0 skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment