lib/cucumber/rb_support/rb_language.rb in cucumber-0.3.101 vs lib/cucumber/rb_support/rb_language.rb in cucumber-0.3.102
- old
+ new
@@ -1,8 +1,10 @@
require 'cucumber/rb_support/rb_dsl'
require 'cucumber/rb_support/rb_world'
require 'cucumber/rb_support/rb_step_definition'
+require 'cucumber/rb_support/rb_hook'
+require 'cucumber/rb_support/rb_transform'
module Cucumber
module RbSupport
# Raised if a World block returns Nil.
class NilWorld < StandardError
@@ -80,10 +82,14 @@
def register_rb_hook(phase, tag_names, proc)
add_hook(phase, RbHook.new(self, tag_names, proc))
end
+ def register_rb_transform(regexp, proc)
+ add_transform(RbTransform.new(self, regexp, proc))
+ end
+
def register_rb_step_definition(regexp, proc)
add_step_definition(RbStepDefinition.new(self, regexp, proc))
end
def build_rb_world_factory(world_modules, proc)
@@ -96,11 +102,11 @@
end
protected
def load_code_file(code_file)
- require code_file # This will cause self.add_step_definition and self.add_hook to be called from RbDsl
+ require code_file # This will cause self.add_step_definition, self.add_hook, and self.add_transform to be called from RbDsl
end
def begin_scenario
begin_rb_scenario
end
@@ -148,6 +154,6 @@
o
end
end
end
end
-end
\ No newline at end of file
+end