Skip to content

Commit

Permalink
Upgrade apt dependency and make use of rspec-puppet-facts
Browse files Browse the repository at this point in the history
Fixes #59.
  • Loading branch information
baurmatt committed Oct 26, 2018
1 parent 3de83af commit 189ad87
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
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

0 comments on commit 189ad87

Please sign in to comment.