Sha256: cd4793782d18ce3501a13feed75653164882efbcd9e66860c7a2a612147059ca

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

module Psychic
  RSpec.describe Runner do
    subject { described_class.new(cwd: current_dir) }
    context 'when psychic.yml exists' do
      let(:hints) do
        {
          'tasks' =>
          {
            'bootstrap' => 'foo',
            'compile'   => 'bar',
            'execute'   => 'baz'
          }
        }
      end

      before(:each) do
        write_file 'psychic.yml', YAML.dump(hints)
      end

      describe 'initialize' do
        it 'should create a HotRunner for the specified directory' do
          expect(subject.hot_runner).to be_an_instance_of(Psychic::Runner::HotRunner)
          expect(subject.cwd).to eq(current_dir)
        end
      end
    end

    context 'when scripts/* exist' do
      before(:each) do
        write_file 'scripts/bootstrap.sh', ''
        write_file 'scripts/foo.sh', ''
      end

      describe 'initialize' do
        it 'should create a cold runner for ShellScriptRunner' do
          expect(subject.cold_runners).to include(
            an_instance_of(Psychic::Runner::Cold::ShellScriptRunner)
          )
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
psychic-runner-0.0.7 spec/psychic/runner_spec.rb
psychic-runner-0.0.6 spec/psychic/runner_spec.rb