diff options
author | Stig Sandbeck Mathisen <ssm@debian.org> | 2012-01-26 11:22:40 +0100 |
---|---|---|
committer | Stig Sandbeck Mathisen <ssm@debian.org> | 2012-01-26 11:22:40 +0100 |
commit | c17b3ba16e7013f06416f10b8752ef783f048717 (patch) | |
tree | 790f13f167199b954007e17d1c55a8d1b0218775 /spec/unit/module_tool/application_spec.rb | |
parent | 32af6143486ceb24a93636445d1883f5fe2299d7 (diff) | |
download | puppet-upstream/2.7.10.tar.gz |
Imported Upstream version 2.7.10upstream/2.7.10
Diffstat (limited to 'spec/unit/module_tool/application_spec.rb')
-rw-r--r-- | spec/unit/module_tool/application_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/unit/module_tool/application_spec.rb b/spec/unit/module_tool/application_spec.rb new file mode 100644 index 000000000..22d3632fd --- /dev/null +++ b/spec/unit/module_tool/application_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' +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 |