Sha256: 74c70d372b7a67bff31717c253319e479e9e64ecf1354b082e3ff1b542899779

Contents?: true

Size: 1.9 KB

Versions: 7

Compression:

Stored size: 1.9 KB

Contents

require 'lopata/id'
require 'lopata/configuration'
require 'lopata/environment'
require 'lopata/scenario_builder'
require 'lopata/scenario'
require 'lopata/step'
require 'lopata/shared_step'

# Namespace for all Lopata code.
module Lopata
  # Define the scenario.
  # @see Lopata::ScenarioBuilder.define
  def self.define(*args, &block)
    Lopata::ScenarioBuilder.define(*args, &block)
  end

  # Skip scenario definition. Option to temporary ignore scenario
  def self.xdefine(*args, &block)
  end

  # 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
  def self.shared_step(name, &block)
    Lopata::SharedStep.register(name, &block)
  end

  # 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
  def self.configure(&block)
    yield Lopata.configuration
  end

  # Returns global configuration object.
  # @return [Lopata::Configuration]
  # @see Lopata.configure
  def self.configuration
    @configuration ||= Lopata::Configuration.new
  end

  # @private
  # Internal container for global non-configuration data.
  def self.world
    @world ||= Lopata::World.new
  end

  # Return global environment object
  # @return [Lopata::Environment]
  # @see Lopata::Environment
  def self.environment
    Lopata.configuration.environment
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lopata-0.1.13 lib/lopata.rb
lopata-0.1.12 lib/lopata.rb
lopata-0.1.11 lib/lopata.rb
lopata-0.1.10 lib/lopata.rb
lopata-0.1.9 lib/lopata.rb
lopata-0.1.8 lib/lopata.rb
lopata-0.1.7 lib/lopata.rb