module Lopata

Namespace for all Lopata code.

Constants

FAILED

@private

PASSED

@private

PENDING

@private

SKIPPED

@private

Public Class Methods

configuration() click to toggle source

Returns global configuration object. @return [Lopata::Configuration] @see Lopata.configure

# File lib/lopata.rb, line 107
def self.configuration
  @configuration ||= Lopata::Configuration.new
end
configure() { |configuration| ... } click to toggle source

Yields the global configuration to a block. @yield [Lopata::Configuration] global configuration

@example

Lopata.configure do |config|
  config.before_scenario 'setup test user'
end

@see Lopata::Configuration

# File lib/lopata.rb, line 100
def self.configure(&block)
  yield Lopata.configuration
end
define(*args, &block) click to toggle source

Define the scenario. @see Lopata::ScenarioBuilder.define

# File lib/lopata.rb, line 13
def self.define(*args, &block)
  Lopata::ScenarioBuilder.define(*args, &block)
end
environment() click to toggle source

Return global environment object @return [Lopata::Environment] @see Lopata::Environment

# File lib/lopata.rb, line 120
def self.environment
  Lopata.configuration.environment
end
shared_context(name, &block) click to toggle source

Register the shared step for context.

shared_context is a shortcat for shared_step('name') { context('name') { .. } }. The block will be arrounded into the context call.

@example

Lopata.shared_context 'calculation' do
  it('correct') { expect(1 + 1).to eq 2 }
  it('incorrect') { expect(1 + 2).to eq 4 }
end

Shared context may be used in scenarios by name: @example

Lopata.define 'verify calcuation in context' do
  verify 'calculation'
end

@param name [String] shared step unique name, will be used as a context's name @param block [Block] shared context definition

# File lib/lopata.rb, line 86
def self.shared_context(name, &block)
  Lopata::SharedStep.register(name) do
    context(name, &block)
  end
end
shared_setup(name, &block) click to toggle source

Register the shared step for setup.

shared_setup is a shortcat for shared_step 'name' { setup { .. } }. The block will be arrounded into the setup call.

@example

Lopata.shared_setup 'test user' do
  @user = create(:user)
end

Shared step may be used in scenarios by name: @example

Lopata.define 'user' do
  setup 'test user'

  it 'exists' do
    expect(@user).to_not be_nil
  end
end

@param name [String] shared step unique name @param block [Block] shared setup definition

# File lib/lopata.rb, line 63
def self.shared_setup(name, &block)
  Lopata::SharedStep.register(name) do
    setup(&block)
  end
end
shared_step(name, &block) click to toggle source

Register the shared step

@example

Lopata.shared_step 'test user' do
  setup { @user = create(:user) }
end

Shared step may be used in scenarios by name: @example

Lopata.define 'user' do
  setup 'test user'

  it 'exists' do
    expect(@user).to_not be_nil
  end
end

@param name [String] shared step unique name @param block [Block] shared step action sequence definition

# File lib/lopata.rb, line 39
def self.shared_step(name, &block)
  Lopata::SharedStep.register(name, &block)
end
world() click to toggle source

@private Internal container for global non-configuration data.

# File lib/lopata.rb, line 113
def self.world
  @world ||= Lopata::World.new
end
xdefine(*args, &block) click to toggle source

Skip scenario definition. Option to temporary ignore scenario

# File lib/lopata.rb, line 18
def self.xdefine(*args, &block)
end