Exception: Cucumber::RbSupport::MultipleWorld

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cucumber/rb_support/rb_language.rb

Overview

Raised if there are 2 or more World blocks.

Instance Method Summary collapse

Constructor Details

#initialize(first_proc, second_proc) ⇒ MultipleWorld

Returns a new instance of MultipleWorld.



16
17
18
19
20
21
22
23
24
# File 'lib/cucumber/rb_support/rb_language.rb', line 16

def initialize(first_proc, second_proc)
  message = "You can only pass a proc to #World once, but it's happening\n"
  message << "in 2 places:\n\n"
  message << first_proc.backtrace_line('World') << "\n"
  message << second_proc.backtrace_line('World') << "\n\n"
  message << "Use Ruby modules instead to extend your worlds. See the Cucumber::RbSupport::RbDsl#World RDoc\n"
  message << "or http://wiki.github.com/aslakhellesoy/cucumber/a-whole-new-world.\n\n"
  super(message)
end