Skip to content

Commit

Permalink
Ruby SOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ford-at-aws committed Feb 13, 2024
1 parent 4a4cafd commit 361cf1f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ruby/example_code/iam/spec/manage_roles_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'aws-sdk-iam'
require 'rspec'
require_relative '../manage_roles'
require "aws-sdk-iam"
require "rspec"
require_relative "../manage_roles"

describe RoleManager do
let(:iam_client) { Aws::IAM::Client.new }
Expand All @@ -19,7 +19,7 @@
]
}
}
let(:policy_arns) { ['arn:aws:iam::aws:policy/ReadOnlyAccess'] }
let(:policy_arns) { ["arn:aws:iam::aws:policy/ReadOnlyAccess"] }

before(:each) do
role_manager.create_role(role_name, assume_role_policy_document, policy_arns)
Expand All @@ -29,31 +29,31 @@
role_manager.delete_role(role_name) rescue nil # Clean up role
end

describe '#create_role' do
it 'creates a role and returns its ARN' do
describe "#create_role" do
it "creates a role and returns its ARN" do
role_arn = role_manager.create_role(role_name, assume_role_policy_document, policy_arns)
expect(role_arn).to be_a(String)
expect(role_arn).to include('arn:aws:iam::')
expect(role_arn).to include("arn:aws:iam::")
end
end

describe '#list_roles' do
it 'lists available roles' do
describe "#list_roles" do
it "lists available roles" do
roles = role_manager.list_roles(100) # Adjust count as necessary
expect(roles).to include(role_name)
end
end

describe '#get_role' do
it 'retrieves data about a specific role' do
describe "#get_role" do
it "retrieves data about a specific role" do
role = role_manager.get_role(role_name)
expect(role).to be_a(Aws::IAM::Role)
expect(role.role_name).to eq(role_name)
end
end

describe '#delete_role' do
it 'deletes a specified role' do
describe "#delete_role" do
it "deletes a specified role" do
expect { role_manager.delete_role(role_name) }.not_to raise_error
end
end
Expand Down

0 comments on commit 361cf1f

Please sign in to comment.