~ubuntu-branches/ubuntu/quantal/puppet/quantal

« back to all changes in this revision

Viewing changes to spec/unit/module_tool/application_spec.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-14 01:56:30 UTC
  • mfrom: (1.1.29) (3.1.43 sid)
  • Revision ID: package-import@ubuntu.com-20120714015630-ntj41rkvkq4zph4y
Tags: 2.7.18-1ubuntu1
* Resynchronise with Debian. (LP: #1023931) Remaining changes:
  - debian/puppetmaster-passenger.postinst: Make sure we error if puppet
    config print doesn't work
  - debian/puppetmaster-passenger.postinst: Ensure upgrades from
    <= 2.7.11-1 fixup passenger apache configuration.
* Dropped upstreamed patches:
  - debian/patches/CVE-2012-1906_CVE-2012-1986_to_CVE-2012-1989.patch
  - debian/patches/puppet-12844
  - debian/patches/2.7.17-Puppet-July-2012-CVE-fixes.patch
* Drop Build-Depends on ruby-rspec (in universe):
  - debian/control: remove ruby-rspec from Build-Depends
  - debian/patches/no-rspec.patch: make Rakefile work anyway if rspec
    isn't installed so we can use it in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
require 'spec_helper'
2
2
require 'puppet/module_tool'
3
3
 
4
 
describe Puppet::Module::Tool::Applications::Application do
 
4
describe Puppet::ModuleTool::Applications::Application, :fails_on_windows => true do
5
5
  describe 'app' do
6
6
 
7
 
    good_versions = %w{ 1.2.4 0.0.1 0.0.0 0.0.2git-8-g3d316d1 0.0.3b1 10.100.10000
8
 
                         0.1.2rc1 0.1.2dev-1 0.1.2svn12345 }
9
 
    bad_versions = %w{ 0.1.2-3 0.1 0 0.1.2.3 dev }
 
7
    good_versions = %w{ 1.2.4 0.0.1 0.0.0 0.0.2-git-8-g3d316d1 0.0.3-b1 10.100.10000
 
8
                         0.1.2-rc1 0.1.2-dev-1 0.1.2-svn12345 0.1.2-3 }
 
9
    bad_versions = %w{ 0.1 0 0.1.2.3 dev 0.1.2beta }
10
10
 
11
11
    before do
12
12
      @app = Class.new(described_class).new
14
14
 
15
15
    good_versions.each do |ver|
16
16
      it "should accept version string #{ver}" do
17
 
        @app.instance_eval("@filename=%q{puppetlabs-ntp-#{ver}}")
18
 
        @app.parse_filename!
 
17
        @app.parse_filename("puppetlabs-ntp-#{ver}")
19
18
      end
20
19
    end
21
20
 
22
21
    bad_versions.each do |ver|
23
22
      it "should not accept version string #{ver}" do
24
 
        @app.instance_eval("@filename=%q{puppetlabs-ntp-#{ver}}")
25
 
        lambda { @app.parse_filename! }.should raise_error
 
23
        lambda { @app.parse_filename("puppetlabs-ntp-#{ver}") }.should raise_error
26
24
      end
27
25
    end
28
26
  end