Module: Hypercuke

Extended by:
Forwardable
Defined in:
lib/hypercuke/cucumber_integration.rb,
lib/hypercuke.rb,
lib/hypercuke/cli.rb,
lib/hypercuke/config.rb,
lib/hypercuke/context.rb,
lib/hypercuke/version.rb,
lib/hypercuke/name_list.rb,
lib/hypercuke/cli/parser.rb,
lib/hypercuke/exceptions.rb,
lib/hypercuke/cli/builder.rb,
lib/hypercuke/step_driver.rb,
lib/hypercuke/step_adapter.rb,
lib/hypercuke/step_adapters.rb,
lib/hypercuke/mini_inflector.rb,
lib/hypercuke/adapter_definition.rb

Overview

NOTE: this file should not be required from the Hypercuke gem itself. It’s intended to be required from within the Cucumber environment (e.g., in features/support/env.rb or equivalent).

Defined Under Namespace

Modules: AdapterDefinition, CucumberIntegration, Error, MiniInflector, StepAdapters Classes: CLI, Config, Context, LayerNotDefinedError, NameList, StepAdapter, StepAdapterNotDefinedError, StepDriver, TopicModule, TopicNotDefinedError

Constant Summary collapse

LAYER_NAME_ENV_VAR =
'HYPERCUKE_LAYER'
MAJOR =
0
MINOR =
5
REVISION =
1
VERSION =
[ MAJOR, MINOR, REVISION ].join('.')

Class Method Summary collapse

Class Method Details

.configObject



31
32
33
# File 'lib/hypercuke.rb', line 31

def self.config
  @config ||= Config.new
end

.current_layerObject



25
26
27
28
# File 'lib/hypercuke.rb', line 25

def self.current_layer
  layer_name = (@current_layer || ENV[LAYER_NAME_ENV_VAR])
  layer_name && layer_name.to_sym
end

.current_layer=(layer_name) ⇒ Object



22
23
24
# File 'lib/hypercuke.rb', line 22

def self.current_layer=(layer_name)
  @current_layer = layer_name ? layer_name.to_sym : nil
end

.reset!Object



16
17
18
19
20
# File 'lib/hypercuke.rb', line 16

def self.reset!
  @config = nil
  @current_layer = nil
  StepAdapters.clear
end

.step_adapter_class(topic_name, layer_name) ⇒ Object

First things first: the point of this entire file.

Should you find yourself in possession of a [topic, layer] name pair, this method allows you to redeem it for VALUABLE PRIZES! (And by “valuable prizes”, I mean “a reference to a step adapter class, if one has already been defined.”)

This method (on Hypercuke itself) is but a facade…



14
15
16
17
# File 'lib/hypercuke/step_adapters.rb', line 14

def self.step_adapter_class(topic_name, layer_name)
  topic_module = StepAdapters.fetch_topic_module(topic_name)
  topic_module.fetch_step_adapter(layer_name)
end

.topic(topic_name, &block) ⇒ Object

Entry point for the adapter definition API



3
4
5
# File 'lib/hypercuke/adapter_definition.rb', line 3

def self.topic(topic_name, &block)
  AdapterDefinition.topic topic_name, &block
end