Sha256: a380687ced5ba1d89c50d77a67da6715a7997e4b9b8ef9b5ea2655a990ee4354

Contents?: true

Size: 1.16 KB

Versions: 21

Compression:

Stored size: 1.16 KB

Contents

describe 'Hash#sort_array!' do
  let(:hash) do
    {:users=>
      {"bob"=>
        {:path=>"/devloper/",
         :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=>"/devloper/",
         :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

21 entries across 21 versions & 1 rubygems

Version Path
miam-0.2.2.beta3 spec/miam/hash_ext_spec.rb