Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
begin refactor of fact. scope out unit tests with valid responses. no…
…w need to refactor fact to be testable
  • Loading branch information
wolfspyre committed Jun 24, 2013
1 parent 64005c3 commit 86646f5
Show file tree
Hide file tree
Showing 12 changed files with 270 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .fixtures.yml
@@ -0,0 +1,5 @@
fixtures:
repositories:
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
symlinks:
vmware_fact: "#{source_dir}"
11 changes: 11 additions & 0 deletions Modulefile
@@ -0,0 +1,11 @@
name 'wolfspyre-vmware'
version '0.0.1'
source 'UNKNOWN'
author 'wolfspyre'
license 'Apache License, Version 2.0'
summary 'a facter fact to convey some information about the hypervisor we're running on'
description 'UNKNOWN'
project_page 'https://github.com/wolfspyre/vmware_puppetfact'
## Add dependencies, if any:
# dependency 'username/name', '>= 1.2.0'
File renamed without changes.
2 changes: 2 additions & 0 deletions Rakefile
@@ -0,0 +1,2 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
File renamed without changes.
16 changes: 16 additions & 0 deletions manifests/init.pp
@@ -0,0 +1,16 @@
# == Class: vmware_fact
#
# This is simply a placeholder class which provides a fact which tells a node
# a little information about the hypervisor on which it lives in vmware
# environments
#
# === Authors
#
# Wolf Noble <wolf@wolfspyre.com>
#
# === Copyright
#
# Copyright 2011 Your name here, unless otherwise noted.
#
class vmware_fact {
}
Empty file added spec/fixtures/manifests/site.pp
Empty file.
1 change: 1 addition & 0 deletions spec/fixtures/modules/stdlib
Submodule stdlib added at ca7633
1 change: 1 addition & 0 deletions spec/fixtures/modules/vmware_fact
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,10 @@
require 'rspec-puppet'
require 'rubygems'
require 'puppetlabs_spec_helper/module_spec_helper'

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))

RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
end
213 changes: 213 additions & 0 deletions spec/unit/vmware_facts_spec.rb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions tests/init.pp
@@ -0,0 +1,11 @@
# The baseline for module testing used by Puppet Labs is that each manifest
# should have a corresponding test manifest that declares that class or defined
# type.
#
# Tests are then run by using puppet apply --noop (to check for compilation errors
# and view a log of events) or by fully applying the test in a virtual environment
# (to compare the resulting system state to the desired state).
#
# Learn more about module testing here: http://docs.puppetlabs.com/guides/tests_smoke.html
#
include vmware

0 comments on commit 86646f5

Please sign in to comment.