Sha256: c57205365ba5ef70bf43170ae4feb2da1459f8f1de9a6e5ce005c30b4a7fc8d1

Contents?: true

Size: 1.7 KB

Versions: 12

Compression:

Stored size: 1.7 KB

Contents

describe Elasticity::AwsUtils do

  describe '.convert_ruby_to_aws_v4' do
    it 'should convert the params' do
      add_jobflow_steps_params = {
        :job_flow_id => 'j-1',
        :string_values => [
          'value1', 'value2'
        ],
        :steps => [
          {
            :action_on_failure => 'CONTINUE',
            :name => 'First New Job Step',
            :hadoop_jar_step => {
              :args => %w(arg1 arg2 arg3),
              :jar => 'first_step.jar',
              :main_class => 'first_class.jar'
            }
          },
          {
            :action_on_failure => 'CANCEL_AND_WAIT',
            :name => 'Second New Job Step',
            :hadoop_jar_step => {
              :args => %w(arg4 arg5 arg6),
              :jar => 'second_step.jar',
              :main_class => 'second_class.jar'
            }
          }
        ]
      }
      expected_result = {
        'JobFlowId' => 'j-1',
        'StringValues' => ['value1', 'value2'],
        'Steps' => [
          {
            'ActionOnFailure' => 'CONTINUE',
            'Name' => 'First New Job Step',
            'HadoopJarStep' => {
              'Args' => %w(arg1 arg2 arg3),
              'Jar' => 'first_step.jar',
              'MainClass' => 'first_class.jar'
            }
          },
          {
            'ActionOnFailure' => 'CANCEL_AND_WAIT',
            'Name' => 'Second New Job Step',
            'HadoopJarStep' => {
              'Args' => %w(arg4 arg5 arg6),
              'Jar' => 'second_step.jar',
              'MainClass' => 'second_class.jar'
            }
          }
        ]
      }
      Elasticity::AwsUtils.send(:convert_ruby_to_aws_v4, add_jobflow_steps_params).should == expected_result
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

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