Sha256: d51246b325df30cda31273f4098262b16c046e5b0c1c393a69a4ba298957f1dd

Contents?: true

Size: 1.34 KB

Versions: 15

Compression:

Stored size: 1.34 KB

Contents

describe Elasticity::StreamingStep do

  subject do
    Elasticity::StreamingStep.new('INPUT_BUCKET', 'OUTPUT_BUCKET', 'MAPPER', 'REDUCER', '-ARG1', 'VALUE1')
  end

  it { should be_a Elasticity::JobFlowStep }

  describe '.initialize' do
    it 'should set the fields appropriately' do
      expect(subject.name).to eql('Elasticity Streaming Step')
      expect(subject.action_on_failure).to eql('TERMINATE_JOB_FLOW')
      expect(subject.input_bucket).to eql('INPUT_BUCKET')
      expect(subject.output_bucket).to eql('OUTPUT_BUCKET')
      expect(subject.mapper).to eql('MAPPER')
      expect(subject.reducer).to eql('REDUCER')
      expect(subject.arguments).to eql(%w(-ARG1 VALUE1))
    end
  end

  describe '#to_aws_step' do

    it 'should convert to aws step format' do
      subject.to_aws_step(Elasticity::JobFlow.new).should == {
        :name => 'Elasticity Streaming Step',
        :action_on_failure => 'TERMINATE_JOB_FLOW',
        :hadoop_jar_step => {
          :jar => '/home/hadoop/contrib/streaming/hadoop-streaming.jar',
          :args => %w(-input INPUT_BUCKET -output OUTPUT_BUCKET -mapper MAPPER -reducer REDUCER -ARG1 VALUE1),
        },
      }
    end

  end

  describe '.requires_installation?' do
    it 'should not require installation' do
      expect(Elasticity::StreamingStep.requires_installation?).to be false
    end
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
elasticity-6.0.14 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.13 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.12 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.11 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.10 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.9 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.8 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.7 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.6 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.5 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.4 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.3 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.2 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0.1 spec/lib/elasticity/streaming_step_spec.rb
elasticity-6.0 spec/lib/elasticity/streaming_step_spec.rb