spec/lib/elasticity/streaming_step_spec.rb in elasticity-5.0.3 vs spec/lib/elasticity/streaming_step_spec.rb in elasticity-6.0
- old
+ new
@@ -4,22 +4,26 @@
Elasticity::StreamingStep.new('INPUT_BUCKET', 'OUTPUT_BUCKET', 'MAPPER', 'REDUCER', '-ARG1', 'VALUE1')
end
it { should be_a Elasticity::JobFlowStep }
- its(:name) { should == 'Elasticity Streaming Step' }
- its(:action_on_failure) { should == 'TERMINATE_JOB_FLOW' }
- its(:input_bucket) { should == 'INPUT_BUCKET' }
- its(:output_bucket) { should == 'OUTPUT_BUCKET' }
- its(:mapper) { should == 'MAPPER' }
- its(:reducer) { should == 'REDUCER' }
- its(:arguments) { should == %w(-ARG1 VALUE1) }
+ 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 == {
+ 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),
@@ -29,10 +33,10 @@
end
describe '.requires_installation?' do
it 'should not require installation' do
- Elasticity::StreamingStep.requires_installation?.should be_false
+ expect(Elasticity::StreamingStep.requires_installation?).to be false
end
end
end