-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I am using rspec with wrong in a rails app. I have the followin in my spec_helper.rb file:
require "wrong/adapters/rspec"
Wrong.config.alias_assert :confirm
However, when I used assert_select, eg:
assert_select 'tbody > tr', count: 4
I get the error:
RuntimeError: You must pass a block to Wrong's assert and deny methods
The exception is thrown from
~/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.9/lib/action_dispatch/testing/assertions/selector.rb
on line 297:
assert matches.size >= min, message if min
It seems wrong is taking over Test::Unit's assert function, causing the function to crash. The alias_assert also doesn't help, since it just aliases the method - the assert method is still there.
I am currently using the following as a workaround:
obj = Object.new
class << obj
include Test::Unit::Assertions
end
Wrong::Assert.send(:define_method, :assert) do |*args, &block|
obj.assert(*args, &block)
end
It works, but it would be nice if a better solution was available.
Metadata
Metadata
Assignees
Labels
No labels