Method: MiniSpec::ClassAPI#reset

Defined in:
lib/minispec/api/class.rb

#reset(*importables) ⇒ Object

Examples:

module CPUTests
  include Minispec

  # CPU related tests
end

module RAMTests
  include Minispec

  # RAM related tests
end

describe :MacBook do
  include CPUTests
  include RAMTests

  # we do not need :around hook nor included variables
  reset :around, :vars

  # will run CPU and RAM tests + any tests defined here
end


54
55
56
57
58
59
60
# File 'lib/minispec/api/class.rb', line 54

def reset *importables
  importables.each do |importable|
    MiniSpec::IMPORTABLES.include?(inheritable.to_sym) || raise(ArgumentError,
      'Do not know how to reset %s. Use one of %s' % [inheritable.inspect, MiniSpec::IMPORTABLES*', '])
    self.send('reset_%s' % inheritable)
  end
end