forked from rspec/rspec-core
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Module#module_exec for ruby 1.8.6. This is needed for the…
… shared example group parameter feature to work. This is based on the implementations in rubinius and backports: - http://github.com/marcandre/backports/blob/v1.18.1/lib/backports/1.8.7/module.rb - http://github.com/evanphx/rubinius/blob/release-1.0.1/kernel/common/module.rb#L438-441
- Loading branch information
1 parent
bf115b7
commit 364f20e
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module RSpec | ||
module Core | ||
module ModuleExtensions | ||
unless respond_to?(:module_exec) | ||
def module_exec(*args, &prc) | ||
instance_exec(*args, &prc) | ||
end | ||
alias_method :class_exec, :module_exec | ||
end | ||
end | ||
end | ||
end | ||
|
||
class Module | ||
include RSpec::Core::ModuleExtensions | ||
end |