Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade apt dependency and make use of rspec-puppet-facts #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ fixtures:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
apt:
repo: "https://github.com/puppetlabs/puppetlabs-apt.git"
ref: "2.4.0"
ref: "6.1.1"
symlinks:
aptly: "#{source_dir}"
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"name": "puppetlabs/apt",
"version_requirement": ">= 2.0.0 < 3.0.0"
"version_requirement": ">= 2.0.0 < 7.0.0"
}
],
"requirements": [
Expand Down
18 changes: 6 additions & 12 deletions spec/classes/aptly_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
require 'spec_helper'

describe 'aptly', type: :class do
[%w[Debian ubuntu trusty], %w[Debian debian jessie]].each do |osfamily, lsbdistid, lsbdistcodename|
on_supported_os.each do |os, os_facts|
let(:facts) do
{
osfamily: osfamily,
lsbdistid: lsbdistid,
lsbdistcodename: lsbdistcodename,
architecture: 'amd64',
puppetversion: Puppet.version
}
os_facts
end

context 'default installation with installation repo on supported os' do
describe "aptly class without any parameters on #{osfamily}" do
describe "aptly class without any parameters on #{os}" do
let(:params) { {} }

it { is_expected.to compile.with_all_deps }
Expand All @@ -28,7 +22,7 @@
end

context 'default params on supported os - testing child classes' do
describe "aptly class with all default parameters on #{osfamily}" do
describe "aptly class with all default parameters on #{os}" do
let(:params) { {} }

###
Expand Down Expand Up @@ -117,7 +111,7 @@
end

context 'different params enforced on supported os' do
describe "aptly class without repo and custom user on #{osfamily}" do
describe "aptly class without repo and custom user on #{os}" do
let(:params) do
{
version: 'installed',
Expand Down Expand Up @@ -185,7 +179,7 @@
end
end

context "aptly class with a version and the repo installation parameters on #{osfamily}" do
context "aptly class with a version and the repo installation parameters on #{os}" do
let(:params) do
{
version: '0.0.1',
Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

include RspecPuppetFacts

default_facts = {
puppetversion: Puppet.version,
facterversion: Facter.version,
}

require 'simplecov'
require 'simplecov-console'

Expand All @@ -18,5 +23,6 @@
end

RSpec.configure do |c|
c.default_facts = default_facts
c.hiera_config = File.expand_path(File.join(__FILE__, '../fixtures/hiera.yaml'))
end