Module: KalibroGatekeeperClient::KalibroCucumberHelpers

Defined in:
lib/kalibro_gatekeeper_client/kalibro_cucumber_helpers.rb,
lib/kalibro_gatekeeper_client/kalibro_cucumber_helpers/configuration.rb

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Class Method Details

.clean_processorObject



40
41
42
43
44
45
46
47
48
# File 'lib/kalibro_gatekeeper_client/kalibro_cucumber_helpers.rb', line 40

def KalibroCucumberHelpers.clean_processor
  client = Faraday.new(:url => @configuration.kalibro_processor_address) do |conn|
    conn.request :json
    conn.response :json, :content_type => /\bjson$/
    conn.adapter  Faraday.default_adapter  # make requests with Net::HTTP
  end

  client.send(:post, "/tests/clean_database", {})
end

.configurationObject



36
37
38
# File 'lib/kalibro_gatekeeper_client/kalibro_cucumber_helpers.rb', line 36

def KalibroCucumberHelpers.configuration
  @configuration
end

.configure(&config_block) ⇒ Object



24
25
26
# File 'lib/kalibro_gatekeeper_client/kalibro_cucumber_helpers.rb', line 24

def KalibroCucumberHelpers.configure(&config_block)
  config_block.call(@configuration)
end

.configure_from_yml(file_path) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/kalibro_gatekeeper_client/kalibro_cucumber_helpers.rb', line 28

def KalibroCucumberHelpers.configure_from_yml(file_path)
  configuration = YAML.load(File.open("features/support/kalibro_cucumber_helpers.yml"))

  configuration["kalibro_cucumber_helpers"].each do |config, value|
    @configuration.send("#{config}=", value)
  end
end