Module: WIP::Runner::Spec::Helpers::CommandHelpers

Defined in:
lib/wip/runner/spec/helpers/command_helpers.rb

Defined Under Namespace

Modules: ExampleCommands

Instance Method Summary collapse

Instance Method Details

#define_command(&block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/wip/runner/spec/helpers/command_helpers.rb', line 4

def define_command(&block)
  klass = Class.new(WIP::Runner::Command)
  klass.instance_exec do
    def name
      'Command'
    end
  end
  klass.class_exec(&block)
  klass
end

#example_command(implementation) ⇒ Object



15
16
17
# File 'lib/wip/runner/spec/helpers/command_helpers.rb', line 15

def example_command(implementation)
  ExampleCommands.const_get(implementation).new(ui)
end