Module: Shoulda::Context
- Defined in:
- lib/shoulda/context/dsl.rb,
lib/shoulda/context/world.rb,
lib/shoulda/context/context.rb,
lib/shoulda/context/railtie.rb,
lib/shoulda/context/version.rb,
lib/shoulda/context/assertions.rb,
lib/shoulda/context/configuration.rb,
lib/shoulda/context/test_framework_detection.rb
Defined Under Namespace
Modules: Assertions, DSL, TestFrameworkDetection Classes: Context, DuplicateTestError, Railtie
Constant Summary collapse
- VERSION =
"3.0.0.rc1".freeze
Class Attribute Summary collapse
-
.contexts ⇒ Object
:nodoc:.
Class Method Summary collapse
-
.add_context(context) ⇒ Object
:nodoc:.
- .configure {|_self| ... } ⇒ Object
-
.current_context ⇒ Object
:nodoc:.
- .extend(mod) ⇒ Object
- .include(mod) ⇒ Object
-
.remove_context ⇒ Object
:nodoc:.
- .test_framework_test_cases ⇒ Object
Class Attribute Details
.contexts ⇒ Object
:nodoc:
4 5 6 |
# File 'lib/shoulda/context/world.rb', line 4 def contexts # :nodoc: @contexts ||= [] end |
Class Method Details
.add_context(context) ⇒ Object
:nodoc:
13 14 15 |
# File 'lib/shoulda/context/world.rb', line 13 def add_context(context) # :nodoc: self.contexts.push(context) end |
.configure {|_self| ... } ⇒ Object
3 4 5 |
# File 'lib/shoulda/context/configuration.rb', line 3 def self.configure yield self end |
.current_context ⇒ Object
:nodoc:
9 10 11 |
# File 'lib/shoulda/context/world.rb', line 9 def current_context # :nodoc: self.contexts.last end |
.extend(mod) ⇒ Object
13 14 15 16 17 |
# File 'lib/shoulda/context/configuration.rb', line 13 def self.extend(mod) test_framework_test_cases.each do |test_case| test_case.extend(mod) end end |
.include(mod) ⇒ Object
7 8 9 10 11 |
# File 'lib/shoulda/context/configuration.rb', line 7 def self.include(mod) test_framework_test_cases.each do |test_case| test_case.class_eval { include mod } end end |
.remove_context ⇒ Object
:nodoc:
17 18 19 |
# File 'lib/shoulda/context/world.rb', line 17 def remove_context # :nodoc: self.contexts.pop end |
.test_framework_test_cases ⇒ Object
29 30 31 |
# File 'lib/shoulda/context/test_framework_detection.rb', line 29 def self.test_framework_test_cases TestFrameworkDetection.test_framework_test_cases end |