Module: Spec::DSL::BehaviourEval::InstanceMethods

Defined in:
lib/spec/dsl/behaviour_eval.rb

Instance Method Summary collapse

Instance Method Details

#initialize(*args, &block) ⇒ Object

:nodoc:



203
204
205
206
# File 'lib/spec/dsl/behaviour_eval.rb', line 203

def initialize(*args, &block) #:nodoc:
  # TODO - inheriting from TestUnit::TestCase fails without this
  # - let's figure out why and move this somewhere else
end

#inspectObject



212
213
214
# File 'lib/spec/dsl/behaviour_eval.rb', line 212

def inspect
  "[RSpec example]"
end

#pending(message) ⇒ Object



216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/spec/dsl/behaviour_eval.rb', line 216

def pending(message)
  if block_given?
    begin
      yield
    rescue Exception => e
      raise Spec::DSL::ExamplePendingError.new(message)
    end
    raise Spec::DSL::PendingFixedError.new("Expected pending '#{message}' to fail. No Error was raised.")
  else
    raise Spec::DSL::ExamplePendingError.new(message)
  end
end

#violated(message = "") ⇒ Object



208
209
210
# File 'lib/spec/dsl/behaviour_eval.rb', line 208

def violated(message="")
  raise Spec::Expectations::ExpectationNotMetError.new(message)
end