Module: Uninhibited::ObjectExtensions

Defined in:
lib/uninhibited/object_extensions.rb

Overview

Extension methods to be included in the global object space for defining features.

Instance Method Summary collapse

Instance Method Details

#Feature(*args, &example_group_block) ⇒ Feature

Defines a new feature:

Feature "User signs in" do
  Given "..."
  When  "..."
  Then  "..."
end

takes.

Parameters:

  • args

    the description, metadata, etc. as RSpec’s #describe method

  • example_group_block

    the block to be executed within the feature

Returns:

  • (Feature)

    the new example group



20
21
22
23
24
25
# File 'lib/uninhibited/object_extensions.rb', line 20

def Feature(*args, &example_group_block)
  describe(*args) do
    extend Uninhibited::Feature
    instance_eval(&example_group_block) if block_given?
  end
end