Sha256: ba4fd0bad60e0905987532db358e03a3f6d5b3e94cf2d49024fc491d1c381872

Contents?: true

Size: 1.62 KB

Versions: 29

Compression:

Stored size: 1.62 KB

Contents

describe Elasticity::CustomJarStep do

  subject do
    Elasticity::CustomJarStep.new('jar')
  end

  it { should be_a Elasticity::JobFlowStep }

  its(:name) { should == 'Elasticity Custom Jar Step' }
  its(:jar) { should == 'jar' }
  its(:arguments) { should == [] }
  its(:action_on_failure) { should == 'TERMINATE_JOB_FLOW' }

  describe '#to_aws_step' do

    it { should respond_to(:to_aws_step).with(1).argument }

    context 'when there are no arguments provided' do
      let(:cjs_with_no_args) { Elasticity::CustomJarStep.new('jar') }

      it 'should convert to aws step format' do
        cjs_with_no_args.to_aws_step(Elasticity::JobFlow.new('access', 'secret')).should == {
          :action_on_failure => 'TERMINATE_JOB_FLOW',
          :hadoop_jar_step => {
            :jar => 'jar'
          },
          :name => 'Elasticity Custom Jar Step'
        }
      end
    end

    context 'when there are arguments provided' do
      let(:cjs_with_args) do
        Elasticity::CustomJarStep.new('jar').tap do |cjs|
          cjs.arguments = ['arg1', 'arg2']
        end
      end

      it 'should convert to aws step format' do
        cjs_with_args.to_aws_step(Elasticity::JobFlow.new('access', 'secret')).should == {
          :action_on_failure => 'TERMINATE_JOB_FLOW',
          :hadoop_jar_step => {
            :jar => 'jar',
            :args => ['arg1', 'arg2',],
          },
          :name => 'Elasticity Custom Jar Step'
        }
      end
    end

  end

  describe '.requires_installation?' do
    it 'should not require installation' do
      Elasticity::CustomJarStep.requires_installation?.should be_false
    end
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
elasticity-5.0.3 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-5.0.2 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-5.0.1 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-4.0.5 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-5.0 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-4.0.4 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-4.0.3 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-4.0.2 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-4.0.1 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-4.0 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-3.0.4 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-3.0.3 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-3.0.2 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-3.0.1 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-3.0 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-2.7 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-2.6 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-2.5.6 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-2.5.5 spec/lib/elasticity/custom_jar_step_spec.rb
elasticity-2.5.3 spec/lib/elasticity/custom_jar_step_spec.rb