Module: Shoulda::SharedContext
- Included in:
- Context, Test::Unit::TestCase
- Defined in:
- lib/shared_should.rb
Defined Under Namespace
Modules: SharedContextMethods
Class Method Summary collapse
-
.extended(klass) ⇒ Object
class methods for Test::Unit::TestCase.
-
.included(klass) ⇒ Object
instance methods for Shoulda::Context.
Class Method Details
.extended(klass) ⇒ Object
class methods for Test::Unit::TestCase
94 95 96 97 98 99 100 101 102 103 |
# File 'lib/shared_should.rb', line 94 def self.extended(klass) class << klass # these methods need to be aliased for both the test class and the should context alias_method :context_without_shared_proxies_executing, :context alias_method :should_without_param_support, :should alias_method :setup_without_param_support, :setup end klass.extend(SharedContextMethods) end |
.included(klass) ⇒ Object
instance methods for Shoulda::Context
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/shared_should.rb', line 106 def self.included(klass) klass.class_eval do # these methods need to be aliased for both the test class and the should context alias :context_without_shared_proxies_executing :context alias :should_without_param_support :should alias :setup_without_param_support :setup # remove any methods we are going to define with our included module SharedContextMethods.instance_methods.each do |method_name| remove_method method_name if method_defined? method_name end end klass.send(:include, SharedContextMethods) end |