Class: ProxyTester::RspecRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/proxy_tester/rspec_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RspecRunner

Returns a new instance of RspecRunner.



13
14
15
16
# File 'lib/proxy_tester/rspec_runner.rb', line 13

def initialize(options = {})
  @test_cases_directory = options.fetch(:test_cases_directory, ProxyTester.config.test_cases_directory)
  @tags                 = options.fetch(:tags, [])
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/proxy_tester/rspec_runner.rb', line 18

def run
  ProxyTester.load_user_database
  ProxyTester.clear_environment

  $LOAD_PATH << test_cases_directory
  test_cases.each do |t|
    Dir.chdir t do
      Bundler.setup
      RSpec::Core::Runner.run(arguments)
    end
  end
end

#to_sObject



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

def to_s
  arguments.join(" ")
end