-
-
Save patrick99e99/af0a33b4f7dfe7bb3361 to your computer and use it in GitHub Desktop.
This file contains 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
# from the context of within an rspec test: | |
mock_it { render :text => "hello" } | |
def mock_it(&block) | |
ApplicationController.class_eval do | |
define_method mocked_method do | |
return block.call if block_given? | |
end | |
end | |
end | |
==> undefined method `render' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_2:0x00000103ad1318> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment