diff options
author | Vasiliy Tolstov <v.tolstov@selfip.ru> | 2014-06-14 01:31:15 +0400 |
---|---|---|
committer | Vasiliy Tolstov <v.tolstov@selfip.ru> | 2014-06-14 01:31:15 +0400 |
commit | 26c6b63ccb6f1ae9fb08ec1f1f6dee08033404fd (patch) | |
tree | 2c731bd3235ff97ac16bd89caf5a1327744e8aa1 | |
parent | 31f9eefa16c87de435141beb1fea5b7cfebfbfae (diff) | |
download | chef-26c6b63ccb6f1ae9fb08ec1f1f6dee08033404fd.tar.gz |
fix test
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
-rw-r--r-- | spec/unit/provider/package/paludis_spec.rb | 207 |
1 files changed, 27 insertions, 180 deletions
diff --git a/spec/unit/provider/package/paludis_spec.rb b/spec/unit/provider/package/paludis_spec.rb index a211268ffd..5d6933cfc9 100644 --- a/spec/unit/provider/package/paludis_spec.rb +++ b/spec/unit/provider/package/paludis_spec.rb @@ -34,49 +34,12 @@ describe Chef::Provider::Package::Paludis do @stdin = StringIO.new @stderr = StringIO.new @stdout =<<-PKG_STATUS -* dev-scm/git - ::arbor 1.8.4.5(~) 1.8.5.5(~) 1.9.2(~)* {:0} - dev-scm/git-1.9.2:0::arbor (system) - Homepage http://git-scm.com/ - Summary A distributed VCS focused on speed, effectivity and real-world usability on large projects - Description Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals - Options - OPTIONS - -baselayout Install baselayout-1 init files - bash-completion Enable bash-completion support - curl Adds support for client-side URL transfer library - -doc Adds extra documentation (API, Javadoc, etc) - emacs Install various Emacs libraries: git.el, git-blame.el and vc-git.el - -python Install helper scripts for git remote helpers, a compatibility layer with other SCMs - systemd Add support for the systemd init daemon (usually by installing units (configuration files)). - -tk Adds support for Tk GUI toolkit - -webdav Adds support for pushing using http:// and https:// transports - -xinetd Add support for the xinetd super-server - -zsh-completion Install completion files for the Z shell - git_remote_helpers - -bzr Install the Bazaar remote helper (e. g. git clone bzr::lp:gnuhello) - -mercurial Install the Mecurial remote helper (e. g. git clone hg::http://selenic.com/repo/hello) - Build Options - symbols=split How to handle debug symbols in installed files - Permitted values: - compress: Split and compress debug symbols - preserve: Preserve debug symbols - split: Split debug symbols - strip: Strip debug symbols - jobs=3 How many jobs the package's build system should use, where supported - Should be an integer >= 1 - -dwarf_compress Compress DWARF2+ debug information - -recommended_tests Run tests considered by the package to be recommended - -trace Trace actions executed by the package (very noisy, for debugging broken builds only) - work=tidyup Whether to preserve or remove working directories - Permitted values: - leave: Do not remove, but allow destructive merges - preserve: Preserve the working directory - remove: Always remove the working directory - tidyup: Tidy up work directory after a successful build - Overridden Masks - Supported platforms ~amd64 ~arm ~x86 - +group/ntp 0 accounts +group/ntp 0 installed-accounts +net/ntp 4.2.6_p5-r2 arbor +user/ntp 0 accounts +user/ntp 0 installed-accounts +net/ntp 4.2.6_p5-r1 installed PKG_STATUS @pid = 12345 @shell_out = OpenStruct.new(:stdout => @stdout,:stdin => @stdin,:stderr => @stderr,:status => @status,:exitstatus => 0) @@ -96,7 +59,7 @@ PKG_STATUS end it "should run pkg info with the package name" do - @provider.should_receive(:shell_out!).with("cave -L warning show #{@new_resource.package_name}").and_return(@shell_out) + @provider.should_receive(:shell_out!).with("cave -L warning print-ids -m \"*/#{@new_resource.package_name.split('/').last}\" -f \"%c/%p %v %r\n\"").and_return(@shell_out) @provider.load_current_resource end @@ -108,83 +71,17 @@ PKG_STATUS it "should set the installed version if package has one" do @stdout.replace(<<-INSTALLED) -* dev-scm/git - ::arbor 1.8.4.5(~) 1.8.5.5(~) 1.9.2(~)* {:0} - ::installed 1.9.2 {:0} - dev-scm/git-1.9.2:0::installed (system) - Description -Git is a fast, scalable, distributed revision control system with an unusually -rich command set that provides both high-level operations and full access to internals - Homepage http://git-scm.com/ - Summary A distributed VCS focused on speed, effectivity and real-world usability on large projects - From repositories arbor - Installed time Mon Apr 28 10:55:08 MSK 2014 - Installed using paludis-1.4.2 - Licences GPL-2 - Options - OPTIONS - (-baselayout) Install baselayout-1 init files - (bash-completion) Enable bash-completion support - (curl) Adds support for client-side URL transfer library - (-doc) Adds extra documentation (API, Javadoc, etc) - (emacs) Install various Emacs libraries: git.el, git-blame.el and vc-git.el - (-python) Install helper scripts for git remote helpers, a compatibility layer with other SCMs - (systemd) Add support for the systemd init daemon (usually by installing units (configuration files)). - (-tk) Adds support for Tk GUI toolkit - (-webdav) Adds support for pushing using http:// and https:// transports - (-xinetd) Add support for the xinetd super-server - (-zsh-completion) Install completion files for the Z shell - git_remote_helpers - (-bzr) Install the Bazaar remote helper (e. g. git clone bzr::lp:gnuhello) - (-mercurial) Install the Mecurial remote helper (e. g. git clone hg::http://selenic.com/repo/hello) - Build Options - -trace Trace actions executed by the package (very noisy, for debugging broken builds only) - dev-scm/git-1.9.2:0::arbor (system) - Homepage http://git-scm.com/ - Summary A distributed VCS focused on speed, effectivity and real-world usability on large projects - Description Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals - Options - OPTIONS - -baselayout Install baselayout-1 init files - bash-completion Enable bash-completion support - curl Adds support for client-side URL transfer library - -doc Adds extra documentation (API, Javadoc, etc) - emacs Install various Emacs libraries: git.el, git-blame.el and vc-git.el - -python Install helper scripts for git remote helpers, a compatibility layer with other SCMs - systemd Add support for the systemd init daemon (usually by installing units (configuration files)). - -tk Adds support for Tk GUI toolkit - -webdav Adds support for pushing using http:// and https:// transports - -xinetd Add support for the xinetd super-server - -zsh-completion Install completion files for the Z shell - git_remote_helpers - -bzr Install the Bazaar remote helper (e. g. git clone bzr::lp:gnuhello) - -mercurial Install the Mecurial remote helper (e. g. git clone hg::http://selenic.com/repo/hello) - Build Options - symbols=split How to handle debug symbols in installed files - Permitted values: - compress: Split and compress debug symbols - preserve: Preserve debug symbols - split: Split debug symbols - strip: Strip debug symbols - jobs=3 How many jobs the package's build system should use, where supported - Should be an integer >= 1 - -dwarf_compress Compress DWARF2+ debug information - -recommended_tests Run tests considered by the package to be recommended - -trace Trace actions executed by the package (very noisy, for debugging broken builds only) - work=tidyup Whether to preserve or remove working directories - Permitted values: - leave: Do not remove, but allow destructive merges - preserve: Preserve the working directory - remove: Always remove the working directory - tidyup: Tidy up work directory after a successful build - Overridden Masks - Supported platforms ~amd64 ~arm ~x86 - +group/ntp 0 accounts +group/ntp 0 installed-accounts +net/ntp 4.2.6_p5-r2 arbor +user/ntp 0 accounts +user/ntp 0 installed-accounts +net/ntp 4.2.6_p5-r1 installed INSTALLED @provider.should_receive(:shell_out!).and_return(@shell_out) @provider.load_current_resource - @current_resource.version.should == "1.9.2" - @provider.candidate_version.should eql("1.9.2") + @current_resource.version.should == "4.2.6_p5-r1" + @provider.candidate_version.should eql("4.2.6_p5-r2") end it "should return the current resource" do @@ -195,46 +92,21 @@ INSTALLED context "when installing a package" do it "should run pkg install with the package name and version" do - @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=dev-scm/git-1.9.2\"") - @provider.install_package("dev-scm/git", "1.9.2") + @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"") + @provider.install_package("net/ntp", "4.2.6_p5-r2") end it "should run pkg install with the package name and version and options if specified" do - @provider.should_receive(:shell_out!).with("cave -L warning resolve -x --preserve-world \"=dev-scm/git-1.9.2\"") + @provider.should_receive(:shell_out!).with("cave -L warning resolve -x --preserve-world \"=net/ntp-4.2.6_p5-r2\"") @new_resource.stub(:options).and_return("--preserve-world") - @provider.install_package("dev-scm/git", "1.9.2") + @provider.install_package("net/ntp", "4.2.6_p5-r2") end it "should not contain invalid characters for the version string" do @stdout.replace(<<-PKG_STATUS) -* sys-process/lsof - ::arbor 4.87(~)* {:0} - sys-process/lsof-4.87:0::arbor - Homepage http://people.freebsd.org/~abe/ - Summary List open files for running UNIX processes - Options - Build Options - symbols=split How to handle debug symbols in installed files - Permitted values: - compress: Split and compress debug symbols - preserve: Preserve debug symbols - split: Split debug symbols - strip: Strip debug symbols - jobs=3 How many jobs the package's build system should use, where supported - Should be an integer >= 1 - -dwarf_compress Compress DWARF2+ debug information - -recommended_tests Run tests considered by the package to be recommended - -trace Trace actions executed by the package (very noisy, for debugging broken builds only) - work=tidyup Whether to preserve or remove working directories - Permitted values: - leave: Do not remove, but allow destructive merges - preserve: Preserve the working directory - remove: Always remove the working directory - tidyup: Tidy up work directory after a successful build - Overridden Masks - Supported platforms ~amd64 ~x86 - +sys-process/lsof 4.87 arbor +sys-process/lsof 4.87 x86_64 PKG_STATUS @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=sys-process/lsof-4.87\"") @provider.install_package("sys-process/lsof", "4.87") @@ -242,33 +114,8 @@ PKG_STATUS it "should not include the human-readable version in the candidate_version" do @stdout.replace(<<-PKG_STATUS) -* sys-process/lsof - ::arbor 4.87(~)* {:0} - sys-process/lsof-4.87:0::arbor - Homepage http://people.freebsd.org/~abe/ - Summary List open files for running UNIX processes - Options - Build Options - symbols=split How to handle debug symbols in installed files - Permitted values: - compress: Split and compress debug symbols - preserve: Preserve debug symbols - split: Split debug symbols - strip: Strip debug symbols - jobs=3 How many jobs the package's build system should use, where supported - Should be an integer >= 1 - -dwarf_compress Compress DWARF2+ debug information - -recommended_tests Run tests considered by the package to be recommended - -trace Trace actions executed by the package (very noisy, for debugging broken builds only) - work=tidyup Whether to preserve or remove working directories - Permitted values: - leave: Do not remove, but allow destructive merges - preserve: Preserve the working directory - remove: Always remove the working directory - tidyup: Tidy up work directory after a successful build - Overridden Masks - Supported platforms ~amd64 ~x86 - +sys-process/lsof 4.87 arbor +sys-process/lsof 4.87 x86_64 PKG_STATUS @provider.should_receive(:shell_out!).and_return(@shell_out) @provider.load_current_resource @@ -279,15 +126,15 @@ PKG_STATUS context "when upgrading a package" do it "should run pkg install with the package name and version" do - @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=dev-scm/git-1.9.2\"") - @provider.upgrade_package("dev-scm/git", "1.9.2") + @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"") + @provider.upgrade_package("net/ntp", "4.2.6_p5-r2") end end context "when uninstalling a package" do it "should run pkg uninstall with the package name and version" do - @provider.should_receive(:shell_out!).with("cave -L warning uninstall -x \"=dev-scm/git-1.9.2\"") - @provider.remove_package("dev-scm/git", "1.9.2") + @provider.should_receive(:shell_out!).with("cave -L warning uninstall -x \"=net/ntp-4.2.6_p5-r2\"") + @provider.remove_package("net/ntp", "4.2.6_p5-r2") end end |