Class: RSpec::Plugins::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-plugins/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

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_groupObject

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

#enabledObject

Returns the value of attribute enabled.



79
80
81
# File 'lib/rspec-plugins/core.rb', line 79

def enabled
  @enabled
end

#proxyObject

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

#disableObject



95
96
97
# File 'lib/rspec-plugins/core.rb', line 95

def disable
  @enabled = false
end

#enableObject



91
92
93
# File 'lib/rspec-plugins/core.rb', line 91

def enable
  @enabled = true
end

#log(message) ⇒ Object



81
82
83
# File 'lib/rspec-plugins/core.rb', line 81

def log(message)
  Core.log(message)
end