Skip to content

Conversation

nibalizer
Copy link
Contributor

This function loads the metadata.json into a puppet variable. This enables a number of neat things such as:

  • Which version of the module am I using? 2.x? 3.x?
  • Which author of the module am I using? puppetlabs? example42?

@raphink
Copy link
Contributor

raphink commented Jul 13, 2015

👍

@DavidS
Copy link
Contributor

DavidS commented Jul 14, 2015

Can we have a few unit tests which check error handling and the major interactions in the function?

@DavidS
Copy link
Contributor

DavidS commented Jul 16, 2015

The two examples you might want to look at https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/spec/functions/has_ip_network_spec.rb for a set of simple tests and https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/spec/functions/assert_private_spec.rb for stubbing stuff on the scope and other things.

@nibalizer nibalizer force-pushed the load_metadata_json branch from f377cf4 to d94733c Compare July 17, 2015 06:27
@nibalizer
Copy link
Contributor Author

Hi David, I've created some really basic tests. Since the function looks on the filesystem for a file I'm not sure exactly how to test this part.

@nibalizer nibalizer force-pushed the load_metadata_json branch from d94733c to 794af1f Compare July 30, 2015 22:35
This function loads the metadata.json into a puppet variable. This enables a number of neat things such as:

* Which version of the module am I using? 2.x? 3.x?
* Which author of the module am I using? puppetlabs? example42?
@nibalizer nibalizer force-pushed the load_metadata_json branch from 794af1f to f411ee7 Compare July 30, 2015 22:54
hunner added a commit that referenced this pull request Jul 31, 2015
@hunner hunner merged commit e815da5 into puppetlabs:master Jul 31, 2015
@nibalizer
Copy link
Contributor Author

Thanks a bunch to @hunner for helping me with this for #puppethack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants