Added modules
This commit is contained in:
parent
c53c931217
commit
59ec520742
646 changed files with 35182 additions and 0 deletions
9
modules/stdlib/spec/monkey_patches/alias_should_to_must.rb
Executable file
9
modules/stdlib/spec/monkey_patches/alias_should_to_must.rb
Executable file
|
@ -0,0 +1,9 @@
|
|||
#! /usr/bin/env ruby -S rspec
|
||||
require 'rspec'
|
||||
|
||||
class Object
|
||||
# This is necessary because the RAL has a 'should'
|
||||
# method.
|
||||
alias :must :should
|
||||
alias :must_not :should_not
|
||||
end
|
11
modules/stdlib/spec/monkey_patches/publicize_methods.rb
Executable file
11
modules/stdlib/spec/monkey_patches/publicize_methods.rb
Executable file
|
@ -0,0 +1,11 @@
|
|||
#! /usr/bin/env ruby -S rspec
|
||||
# Some monkey-patching to allow us to test private methods.
|
||||
class Class
|
||||
def publicize_methods(*methods)
|
||||
saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods
|
||||
|
||||
self.class_eval { public(*saved_private_instance_methods) }
|
||||
yield
|
||||
self.class_eval { private(*saved_private_instance_methods) }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue