Class: RSpec::Plugins::Base
- Inherits:
-
Object
- Object
- RSpec::Plugins::Base
- Defined in:
- lib/rspec-plugins/core.rb
Instance Attribute Summary collapse
-
#current_example_group ⇒ Object
Returns the value of attribute current_example_group.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
Instance Method Summary collapse
- #after(*args, &block) ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #log(message) ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
85 86 87 88 89 |
# File 'lib/rspec-plugins/core.rb', line 85 def initialize @enabled = false @proxy = nil @current_example_group = nil end |
Instance Attribute Details
#current_example_group ⇒ Object
Returns the value of attribute current_example_group.
79 80 81 |
# File 'lib/rspec-plugins/core.rb', line 79 def current_example_group @current_example_group end |
#enabled ⇒ Object
Returns the value of attribute enabled.
79 80 81 |
# File 'lib/rspec-plugins/core.rb', line 79 def enabled @enabled end |
#proxy ⇒ Object
Returns the value of attribute proxy.
79 80 81 |
# File 'lib/rspec-plugins/core.rb', line 79 def proxy @proxy end |
Instance Method Details
#after(*args, &block) ⇒ Object
99 100 101 102 103 104 |
# File 'lib/rspec-plugins/core.rb', line 99 def after(*args, &block) plugin = self @current_example_group.send :after, :all do block.call(plugin, *args) end end |
#disable ⇒ Object
95 96 97 |
# File 'lib/rspec-plugins/core.rb', line 95 def disable @enabled = false end |
#enable ⇒ Object
91 92 93 |
# File 'lib/rspec-plugins/core.rb', line 91 def enable @enabled = true end |