Class: TurboTest::RSpec::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/turbo_test/rspec/job.rb

Constant Summary collapse

PATTERN =
"spec/**/*_spec.rb"

Instance Method Summary collapse

Constructor Details

#initialize(path, **options) ⇒ Job

Returns a new instance of Job.



33
34
35
# File 'lib/turbo_test/rspec/job.rb', line 33

def initialize(path, **options)
	@path = path
end

Instance Method Details

#call(packer:, stdout: $stdout, stderr: $stderr) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/turbo_test/rspec/job.rb', line 37

def call(packer:, stdout: $stdout, stderr: $stderr)
	reset_rspec_state!
	
	options = ConfigurationOptions.new([@path],
		packer: packer
	)
	
	runner = ::RSpec::Core::Runner.new(options)
	
	runner.run(stdout, stderr)
end