Exception: RspecN::BadOption

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rspec_n/errors/bad_option.rb

Instance Method Summary collapse

Constructor Details

#initialize(msg = "") ⇒ BadOption

Returns a new instance of BadOption.



3
4
5
6
# File 'lib/rspec_n/errors/bad_option.rb', line 3

def initialize(msg="")
  @details = msg
  super
end

Instance Method Details

#messageObject



8
9
10
11
# File 'lib/rspec_n/errors/bad_option.rb', line 8

def message
  allowed = RspecN::ALLOWED_ORDER_OPTIONS.collect { |val| "'#{val}'" }
  "Order must be #{allowed.to_sentence}.  '#{@details}' is not allowed.\n"
end