forked from puppetlabs-toy-chest/puppet-module-tool
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request puppetlabs-toy-chest#5 from jeffmccune/ticket/mast…
…er/4_semver_support Ticket/master/4 semver support
- Loading branch information
Showing
2 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Tested this spec test with rspec 2.5.1 | ||
|
||
require 'puppet/module/tool' | ||
|
||
describe Puppet::Module::Tool::Applications::Application do | ||
|
||
describe 'app' do | ||
|
||
good_versions = %w{ 1.2.4 0.0.1 0.0.0 0.0.2git-8-g3d316d1 0.0.3b1 10.100.10000 | ||
0.1.2rc1 0.1.2dev-1 0.1.2svn12345 } | ||
bad_versions = %w{ 0.1.2-3 0.1 0 0.1.2.3 dev } | ||
|
||
before do | ||
@app = Class.new(described_class).new | ||
end | ||
|
||
good_versions.each do |ver| | ||
it "should accept version string #{ver}" do | ||
@app.instance_eval("@filename=%q{puppetlabs-ntp-#{ver}}") | ||
@app.parse_filename! | ||
end | ||
end | ||
|
||
bad_versions.each do |ver| | ||
it "should not accept version string #{ver}" do | ||
@app.instance_eval("@filename=%q{puppetlabs-ntp-#{ver}}") | ||
lambda { @app.parse_filename! }.should raise_error | ||
end | ||
end | ||
|
||
end | ||
|
||
end |