Sha256: 4990fd67739cbbf87c42153e748be9cde9e52f6c8993aadf9645328d98d305b1

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

Contents

describe 'Hash#sort_array!' do
  let(:hash) do
    {:users=>
      {"bob"=>
        {:path=>"/developer/",
         :groups=>[],
         :policies=>
          {"S3"=>
            {"Statement"=>
              [{"Action"=>["s3:Put*", "s3:List*", "s3:Get*"],
                "Effect"=>"Allow",
                "Resource"=>"*"}]}},
         :attached_managed_policies=>[
          "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess",
          "arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess"],
         :login_profile=>{:password_reset_required=>true}}}}
  end

  let(:expected_hash) do
    {:users=>
      {"bob"=>
        {:path=>"/developer/",
         :groups=>[],
         :policies=>
          {"S3"=>
            {"Statement"=>
              [{"Action"=>["s3:Get*", "s3:List*", "s3:Put*"],
                "Effect"=>"Allow",
                "Resource"=>"*"}]}},
         :attached_managed_policies=>[
          "arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess",
          "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess"],
         :login_profile=>{:password_reset_required=>true}}}}
  end

  subject { hash.sort_array! }

  it { is_expected.to eq expected_hash }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
miam-0.2.5.beta1 spec/miam/hash_ext_spec.rb
miam-0.2.4 spec/miam/hash_ext_spec.rb
miam-0.2.4.beta18 spec/miam/hash_ext_spec.rb
miam-0.2.4.beta17 spec/miam/hash_ext_spec.rb
miam-0.2.4.beta16 spec/miam/hash_ext_spec.rb
miam-0.2.4.beta15 spec/miam/hash_ext_spec.rb