Displaying 1 result from an estimated 1 matches for "add_to_environ".
2008 Mar 13
0
Equivalent to before(:all) for StepGroups?
...n I reference it within a step
block.  To get it to work, I have to create the object within a step
block:
  steps_for(:all) do
  #TODO: This is a total kludge.
  Given /an environment/ do
    @om = ObjectManager.new
    @environment = @om.resolve_objects("an environment").first
    def add_to_environment(object)
      @environment << object
      object
    end
    @om.on_create("target") {add_to_environment Creature.new}
    @om.on_create("creature") {add_to_environment Creature.new}
    @om.on_create("game object") {add_to_environment GameObject.new}
  end...