From 6b38dd71f8fc47591fb69edf8e317f88487739fe Mon Sep 17 00:00:00 2001 From: Shinichi Ishimura Date: Mon, 25 Dec 2017 20:23:41 +0900 Subject: [PATCH 1/5] Return the result of tempFile instead of of sleep. "sleep" returns sleep time, which is integer. Therefore "apply" ends up always returning a truthy value. --- spec/spec_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4958f24..346dfcd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -67,7 +67,7 @@ def tempfile(content, options = {}) end def apply(cli = client) - tempfile(yield) do |f| + result = tempfile(yield) do |f| begin cli.apply(f.path) rescue Aws::IAM::Errors::EntityTemporarilyUnmodifiable, Aws::IAM::Errors::Throttling, Aws::IAM::Errors::NoSuchEntity @@ -77,6 +77,7 @@ def apply(cli = client) end sleep ENV['APPLY_WAIT'].to_i + result end def export(options = {}) From 0de1b38928bef941ec30cad641f97f3aede25f67 Mon Sep 17 00:00:00 2001 From: Shinichi Ishimura Date: Mon, 25 Dec 2017 20:59:12 +0900 Subject: [PATCH 2/5] Make it possible to specify multiple "target" and "exclude" options --- bin/miam | 4 ++-- lib/miam/client.rb | 4 ++-- lib/miam/dsl/converter.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/miam b/bin/miam index 280fbad..7996acb 100755 --- a/bin/miam +++ b/bin/miam @@ -51,8 +51,8 @@ ARGV.options do |opt| opt.on('' , '--split-more') { split = :more } opt.on('', '--format=FORMAT', [:ruby, :json]) {|v| format_passed = true; options[:format] = v } opt.on('' , '--export-concurrency N', Integer) {|v| options[:export_concurrency] = v } - opt.on('' , '--target REGEXP') {|v| options[:target] = Regexp.new(v) } - opt.on('' , '--exclude REGEXP') {|v| options[:exclude] = Regexp.new(v) } + opt.on('' , '--target REGEXP') {|v| (options[:target] ||= []) << Regexp.new(v) } + opt.on('' , '--exclude REGEXP') {|v| (options[:exclude] ||= []) << Regexp.new(v) } opt.on('' , '--ignore-login-profile') { options[:ignore_login_profile] = true } opt.on('' , '--no-color') { options[:color] = false } opt.on('' , '--no-progress') { options[:no_progress] = true } diff --git a/lib/miam/client.rb b/lib/miam/client.rb index 014e0b1..8c4b620 100644 --- a/lib/miam/client.rb +++ b/lib/miam/client.rb @@ -527,11 +527,11 @@ def target_matched?(name) result = true if @options[:exclude] - result &&= name !~ @options[:exclude] + result &&= @options[:exclude].all? {|r| name !~ r} end if @options[:target] - result &&= name =~ @options[:target] + result &&= @options[:target].any? {|r| name =~ r} end result diff --git a/lib/miam/dsl/converter.rb b/lib/miam/dsl/converter.rb index 6f4c77c..b225b06 100644 --- a/lib/miam/dsl/converter.rb +++ b/lib/miam/dsl/converter.rb @@ -196,11 +196,11 @@ def target_matched?(name) result = true if @options[:exclude] - result &&= name !~ @options[:exclude] + result &&= @options[:exclude].all? {|r| name !~ r} end if @options[:target] - result &&= name =~ @options[:target] + result &&= @options[:target].any? {|r| name =~ r} end result From 1968e6860018131f6d3148dac3284e2dfd2f2b81 Mon Sep 17 00:00:00 2001 From: Shinichi Ishimura Date: Mon, 25 Dec 2017 22:48:09 +0900 Subject: [PATCH 3/5] Add specs for exclude and target option --- spec/miam/exclude_spec.rb | 237 ++++++++++++++++++++++++++++++++++++++ spec/miam/target_spec.rb | 185 +++++++++++++++++++++++++++++ 2 files changed, 422 insertions(+) create mode 100644 spec/miam/exclude_spec.rb create mode 100644 spec/miam/target_spec.rb diff --git a/spec/miam/exclude_spec.rb b/spec/miam/exclude_spec.rb new file mode 100644 index 0000000..32e1a02 --- /dev/null +++ b/spec/miam/exclude_spec.rb @@ -0,0 +1,237 @@ +describe 'target/exclude options' do + let(:dsl) do + <<-RUBY + user "bob", :path=>"/devloper/" do + login_profile :password_reset_required=>true + + groups( + "Admin", + "SES" + ) + + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + user "mary", :path=>"/staff/" do + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "Admin", :path=>"/admin/" do + policy "Admin" do + {"Statement"=>[{"Effect"=>"Allow", "Action"=>"*", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "SES", :path=>"/ses/" do + policy "ses-policy" do + {"Statement"=> + [{"Effect"=>"Allow", "Action"=>"ses:SendRawEmail", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + role "my-role", :path=>"/any/" do + instance_profiles( + "my-instance-profile" + ) + + assume_role_policy_document do + {"Version"=>"2012-10-17", + "Statement"=> + [{"Sid"=>"", + "Effect"=>"Allow", + "Principal"=>{"Service"=>"ec2.amazonaws.com"}, + "Action"=>"sts:AssumeRole"}]} + end + + policy "role-policy" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + instance_profile "my-instance-profile", :path=>"/profile/" + RUBY + end + + before(:each) do + apply { dsl } + end + + context 'when exclude a user' do + let(:exclude_bob) do + <<-RUBY + user "mary", :path=>"/staff/" do + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "Admin", :path=>"/admin/" do + policy "Admin" do + {"Statement"=>[{"Effect"=>"Allow", "Action"=>"*", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "SES", :path=>"/ses/" do + policy "ses-policy" do + {"Statement"=> + [{"Effect"=>"Allow", "Action"=>"ses:SendRawEmail", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + role "my-role", :path=>"/any/" do + instance_profiles( + "my-instance-profile" + ) + + assume_role_policy_document do + {"Version"=>"2012-10-17", + "Statement"=> + [{"Sid"=>"", + "Effect"=>"Allow", + "Principal"=>{"Service"=>"ec2.amazonaws.com"}, + "Action"=>"sts:AssumeRole"}]} + end + + policy "role-policy" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + instance_profile "my-instance-profile", :path=>"/profile/" + RUBY + end + + subject { client(exclude: [/bob/]) } + + it do + updated = apply(subject) { exclude_bob } + expect(updated).to be_falsey + end + end + + context 'when exclude a group, a role and an instance profile' do + let(:exclude_admin_and_my) do + <<-RUBY + user "bob", :path=>"/devloper/" do + login_profile :password_reset_required=>true + + groups( + "Admin", + "SES" + ) + + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + user "mary", :path=>"/staff/" do + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "SES", :path=>"/ses/" do + policy "ses-policy" do + {"Statement"=> + [{"Effect"=>"Allow", "Action"=>"ses:SendRawEmail", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + RUBY + end + + subject { client(exclude: [/Admin/, /^my-/]) } + + it do + updated = apply(subject) { exclude_admin_and_my } + expect(updated).to be_falsey + end + end +end diff --git a/spec/miam/target_spec.rb b/spec/miam/target_spec.rb new file mode 100644 index 0000000..5cc7b54 --- /dev/null +++ b/spec/miam/target_spec.rb @@ -0,0 +1,185 @@ +describe 'target option' do + let(:dsl) do + <<-RUBY + user "bob", :path=>"/devloper/" do + login_profile :password_reset_required=>true + + groups( + "Admin", + "SES" + ) + + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + user "mary", :path=>"/staff/" do + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "Admin", :path=>"/admin/" do + policy "Admin" do + {"Statement"=>[{"Effect"=>"Allow", "Action"=>"*", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + group "SES", :path=>"/ses/" do + policy "ses-policy" do + {"Statement"=> + [{"Effect"=>"Allow", "Action"=>"ses:SendRawEmail", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + role "my-role", :path=>"/any/" do + instance_profiles( + "my-instance-profile" + ) + + assume_role_policy_document do + {"Version"=>"2012-10-17", + "Statement"=> + [{"Sid"=>"", + "Effect"=>"Allow", + "Principal"=>{"Service"=>"ec2.amazonaws.com"}, + "Action"=>"sts:AssumeRole"}]} + end + + policy "role-policy" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + instance_profile "my-instance-profile", :path=>"/profile/" + RUBY + end + + before(:each) do + apply { dsl } + end + + context 'when target a user' do + let(:target_bob) do + <<-RUBY + user "bob", :path=>"/devloper/" do + login_profile :password_reset_required=>true + + groups( + "Admin", + "SES" + ) + + policy "S3" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + RUBY + end + + subject { client(target: [/bob/]) } + + it do + updated = apply(subject) { target_bob } + expect(updated).to be_falsey + end + end + + context 'when target a group, a role and an instance profile' do + let(:target_admin_and_my) do + <<-RUBY + group "Admin", :path=>"/admin/" do + policy "Admin" do + {"Statement"=>[{"Effect"=>"Allow", "Action"=>"*", "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + role "my-role", :path=>"/any/" do + instance_profiles( + "my-instance-profile" + ) + + assume_role_policy_document do + {"Version"=>"2012-10-17", + "Statement"=> + [{"Sid"=>"", + "Effect"=>"Allow", + "Principal"=>{"Service"=>"ec2.amazonaws.com"}, + "Action"=>"sts:AssumeRole"}]} + end + + policy "role-policy" do + {"Statement"=> + [{"Action"=> + ["s3:Get*", + "s3:List*"], + "Effect"=>"Allow", + "Resource"=>"*"}]} + end + + attached_managed_policies( + "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess" + ) + end + + instance_profile "my-instance-profile", :path=>"/profile/" + RUBY + end + + subject { client(target: [/Admin/, /^my-/]) } + + it do + updated = apply(subject) { target_admin_and_my } + expect(updated).to be_falsey + end + end +end From 446b254e8c451ee280f594e82396b964288bb12d Mon Sep 17 00:00:00 2001 From: Shinichi Ishimura Date: Sun, 31 Dec 2017 13:08:20 +0900 Subject: [PATCH 4/5] Fix typos --- spec/miam/attach_detach_policy_spec.rb | 8 ++++---- spec/miam/create_spec.rb | 6 +++--- spec/miam/delete_spec.rb | 12 ++++++------ spec/miam/exclude_spec.rb | 4 ++-- spec/miam/hash_ext_spec.rb | 4 ++-- spec/miam/ignore_login_profile_spec.rb | 6 +++--- spec/miam/rename_spec.rb | 12 ++++++------ spec/miam/target_spec.rb | 4 ++-- spec/miam/update_spec.rb | 22 +++++++++++----------- 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/spec/miam/attach_detach_policy_spec.rb b/spec/miam/attach_detach_policy_spec.rb index a314cd8..964189e 100644 --- a/spec/miam/attach_detach_policy_spec.rb +++ b/spec/miam/attach_detach_policy_spec.rb @@ -1,7 +1,7 @@ describe 'attach/detach policy' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -94,7 +94,7 @@ let(:expected) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>["Admin", "SES"], :attached_managed_policies=>[ "arn:aws:iam::aws:policy/AmazonElastiCacheReadOnlyAccess"], @@ -174,7 +174,7 @@ context 'when attach policy' do let(:update_policy_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -282,7 +282,7 @@ context 'when detach policy' do let(:update_policy_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( diff --git a/spec/miam/create_spec.rb b/spec/miam/create_spec.rb index 6a3b654..66cde9b 100644 --- a/spec/miam/create_spec.rb +++ b/spec/miam/create_spec.rb @@ -12,7 +12,7 @@ context 'when create user and group' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -88,7 +88,7 @@ let(:expected) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>["Admin", "SES"], :attached_managed_policies=>[], :policies=> @@ -184,7 +184,7 @@ end end - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do include_template context.user_name end diff --git a/spec/miam/delete_spec.rb b/spec/miam/delete_spec.rb index 2b8b1bd..91d2be6 100644 --- a/spec/miam/delete_spec.rb +++ b/spec/miam/delete_spec.rb @@ -1,7 +1,7 @@ describe 'delete' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -74,7 +74,7 @@ let(:expected) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>["Admin", "SES"], :attached_managed_policies=>[], :policies=> @@ -139,7 +139,7 @@ context 'when delete group' do let(:delete_group_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -351,7 +351,7 @@ context 'when delete instance_profile' do let(:delete_instance_profiles_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -432,7 +432,7 @@ context 'when delete role' do let(:delete_role_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -491,7 +491,7 @@ context 'when delete role and instance_profile' do let(:delete_role_and_instance_profile_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( diff --git a/spec/miam/exclude_spec.rb b/spec/miam/exclude_spec.rb index 32e1a02..b6e9d03 100644 --- a/spec/miam/exclude_spec.rb +++ b/spec/miam/exclude_spec.rb @@ -1,7 +1,7 @@ describe 'target/exclude options' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -177,7 +177,7 @@ context 'when exclude a group, a role and an instance profile' do let(:exclude_admin_and_my) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( diff --git a/spec/miam/hash_ext_spec.rb b/spec/miam/hash_ext_spec.rb index 2f81fce..3a8b07e 100644 --- a/spec/miam/hash_ext_spec.rb +++ b/spec/miam/hash_ext_spec.rb @@ -2,7 +2,7 @@ let(:hash) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>[], :policies=> {"S3"=> @@ -19,7 +19,7 @@ let(:expected_hash) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>[], :policies=> {"S3"=> diff --git a/spec/miam/ignore_login_profile_spec.rb b/spec/miam/ignore_login_profile_spec.rb index f65853e..4487100 100644 --- a/spec/miam/ignore_login_profile_spec.rb +++ b/spec/miam/ignore_login_profile_spec.rb @@ -1,7 +1,7 @@ describe 'ignore login profile' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true policy "S3" do @@ -18,7 +18,7 @@ let(:update_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>false policy "S3" do @@ -37,7 +37,7 @@ let(:expected) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>[], :policies=> {"S3"=> diff --git a/spec/miam/rename_spec.rb b/spec/miam/rename_spec.rb index acc98b8..1c52ada 100644 --- a/spec/miam/rename_spec.rb +++ b/spec/miam/rename_spec.rb @@ -1,7 +1,7 @@ describe 'update' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -74,7 +74,7 @@ let(:expected) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>["Admin", "SES"], :attached_managed_policies=>[], :policies=> @@ -139,7 +139,7 @@ context 'when rename user' do let(:rename_user_dsl) do <<-RUBY - user "bob2", :path=>"/devloper/", :renamed_from=>"bob" do + user "bob2", :path=>"/developer/", :renamed_from=>"bob" do login_profile :password_reset_required=>true groups( @@ -222,7 +222,7 @@ context 'when rename group' do let(:rename_group_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -306,7 +306,7 @@ context 'when rename without renamed_from' do let(:rename_without_renamed_from_dsl) do <<-RUBY - user "bob2", :path=>"/devloper/" do + user "bob2", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -391,7 +391,7 @@ context 'when rename role and instance_profile' do let(:rename_role_and_instance_profile_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( diff --git a/spec/miam/target_spec.rb b/spec/miam/target_spec.rb index 5cc7b54..4b907e9 100644 --- a/spec/miam/target_spec.rb +++ b/spec/miam/target_spec.rb @@ -1,7 +1,7 @@ describe 'target option' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -98,7 +98,7 @@ context 'when target a user' do let(:target_bob) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( diff --git a/spec/miam/update_spec.rb b/spec/miam/update_spec.rb index c1c6dcb..59a44b6 100644 --- a/spec/miam/update_spec.rb +++ b/spec/miam/update_spec.rb @@ -1,7 +1,7 @@ describe 'update' do let(:dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -74,7 +74,7 @@ let(:expected) do {:users=> {"bob"=> - {:path=>"/devloper/", + {:path=>"/developer/", :groups=>["Admin", "SES"], :attached_managed_policies=>[], :policies=> @@ -149,7 +149,7 @@ context 'when update policy' do let(:update_policy_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -236,7 +236,7 @@ context 'when update path' do let(:update_path_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -320,7 +320,7 @@ context 'when update path (role, instance_profile)' do let(:cannot_update_path_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -409,7 +409,7 @@ context 'when update assume_role_policy' do let(:update_assume_role_policy_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -492,7 +492,7 @@ context 'when update groups' do let(:update_groups_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -580,7 +580,7 @@ context 'when update login_profile' do let(:update_login_profile_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>false groups( @@ -663,7 +663,7 @@ context 'when delete login_profile' do let(:delete_login_profile_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do groups( "Admin", "SES" @@ -744,7 +744,7 @@ context 'when delete policy' do let(:delete_policy_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( @@ -807,7 +807,7 @@ context 'when update instance_profiles' do let(:update_instance_profiles_dsl) do <<-RUBY - user "bob", :path=>"/devloper/" do + user "bob", :path=>"/developer/" do login_profile :password_reset_required=>true groups( From ac83ae343b638ed12a83959d37c33d379fd068bd Mon Sep 17 00:00:00 2001 From: Shinichi Ishimura Date: Sun, 31 Dec 2017 13:09:38 +0900 Subject: [PATCH 5/5] Correct description --- spec/miam/exclude_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/miam/exclude_spec.rb b/spec/miam/exclude_spec.rb index b6e9d03..dbee9cc 100644 --- a/spec/miam/exclude_spec.rb +++ b/spec/miam/exclude_spec.rb @@ -1,4 +1,4 @@ -describe 'target/exclude options' do +describe 'exclude option' do let(:dsl) do <<-RUBY user "bob", :path=>"/developer/" do