summaryrefslogtreecommitdiff
path: root/spec/aws_spec.rb
blob: 5381853940b7a393d0548cf5f049d4240f4ab2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
describe "stronglifters::aws" do
  subject do
    ChefSpec::SoloRunner.new do |node|
      node.set["stronglifters"]["username"] = username
      node.set["etc"]["passwd"][username]["dir"] = "/home/#{username}"
    end.converge(described_recipe)
  end

  let(:username) { FFaker::Internet.user_name }

  it "installs python-ip" do
    expect(subject).to install_package("python-pip")
  end

  it "installs awscli" do
    expect(subject).to run_execute("pip install awscli")
  end

  it "installs the config file" do
    expect(subject).to create_template("/home/#{username}/.aws/config")
  end

  it "installs the credentials file" do
    expect(subject).to create_template("/home/#{username}/.aws/credentials")
  end
end