Sha256: 6539b802a706a4757378440082c8998fc22e6b3deb859f613eff5367a673fa66

Contents?: true

Size: 901 Bytes

Versions: 11

Compression:

Stored size: 901 Bytes

Contents

require 'forwardable'

class TestRunner
  include MessageDriver::Client
  include RSpec::Matchers
  extend Forwardable

  attr_accessor :raised_error
  attr_accessor :current_feature_file

  def provider
    @provider ||= Provider.new
  end

  def_delegators :provider, :broker_name, :broker_name=, :fetch_messages, :fetch_destination, :fetch_current_adapter_context, :purge_destination, :pause_if_needed

  def run_config_code(src)
    instance_eval(src, current_feature_file)
  end

  def run_test_code(src)
    instance_eval(src, current_feature_file)
  rescue => e
    @raised_error = e
  end

  def publish_table_to_destination(destination, table)
    table.hashes.each do |msg|
      destination.publish(msg[:body], msg[:headers] || {}, msg[:properties] || {})
    end
  end
end

module KnowsMyTestRunner
  def test_runner
    @test_runner ||= TestRunner.new
  end
end

World(KnowsMyTestRunner)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
message-driver-1.0.1 features/support/test_runner.rb
message-driver-1.0.0 features/support/test_runner.rb
message-driver-0.7.2 features/support/test_runner.rb
message-driver-0.7.1 features/support/test_runner.rb
message-driver-0.7.0 features/support/test_runner.rb
message-driver-0.6.1 features/support/test_runner.rb
message-driver-0.6.0 features/support/test_runner.rb
message-driver-0.5.3 features/support/test_runner.rb
message-driver-0.5.2 features/support/test_runner.rb
message-driver-0.5.1 features/support/test_runner.rb
message-driver-0.5.0 features/support/test_runner.rb