Class: ReeSpecCli::RunPackageSpecs

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_spec/packages/ree_spec_cli/package/ree_spec_cli/services/run_package_specs.rb

Defined Under Namespace

Classes: CommandResult

Instance Method Summary collapse

Instance Method Details

#call(package, files, test_env_number) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ree_spec/packages/ree_spec_cli/package/ree_spec_cli/services/run_package_specs.rb', line 13

def call(package, files, test_env_number)
  package_path = File.join(Ree.root_dir, package.dir)
  package_spec_path = File.join(package_path, 'spec')
  package_spec_helper = File.join(package_path, 'spec', 'spec_helper.rb')
  result = nil

  FileUtils.cd(Ree.root_dir) do
    result = run_shell_command(
      "TEST_ENV_NUMBER=#{test_env_number} bundle exec rspec --color --tty #{files.join(" ")} --default-path=#{package_spec_path} --require=#{package_spec_helper}"
    )
  end

  result
end