package_manager 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/package_manager.rb +1 -1
- data/lib/package_manager/port.rb +1 -1
- data/spec/script_methods_spec.rb +11 -17
- metadata +4 -4
data/lib/package_manager.rb
CHANGED
data/lib/package_manager/port.rb
CHANGED
data/spec/script_methods_spec.rb
CHANGED
@@ -8,13 +8,11 @@ require File.join( ROOT_PATH, 'lib', 'package_manager' )
|
|
8
8
|
describe 'script methods' do
|
9
9
|
|
10
10
|
before( :all ) do
|
11
|
-
PackageManager::Base.
|
12
|
-
PackageManager::Base.stub!( :program_installed? ).with( 'apt-get' ).and_return( true )
|
13
|
-
@pkg = PackageManager::Base.load
|
11
|
+
@pkg = PackageManager::Base.load( 'apt' )
|
14
12
|
end
|
15
13
|
|
16
14
|
it "should run commands through a subprocess" do
|
17
|
-
|
15
|
+
IO.should_receive( :popen ).and_return( "foo\n" )
|
18
16
|
@pkg.find_available( 'pkg' )
|
19
17
|
end
|
20
18
|
|
@@ -33,31 +31,27 @@ describe 'script methods' do
|
|
33
31
|
@pkg.list_contents( 'pkg' ).should be_a( Array )
|
34
32
|
end
|
35
33
|
|
36
|
-
it "#install should
|
37
|
-
|
38
|
-
@pkg.
|
39
|
-
@pkg.install( 'pkg' ).should be_true
|
34
|
+
it "#install should replace the current process via exec" do
|
35
|
+
@pkg.should_receive( :exec )
|
36
|
+
@pkg.install( 'pkg' )
|
40
37
|
end
|
41
38
|
|
42
|
-
it "#install_file should
|
43
|
-
|
44
|
-
@pkg.stub!( :run_command )
|
39
|
+
it "#install_file should replace the current process via exec" do
|
40
|
+
@pkg.should_receive( :exec )
|
45
41
|
File.stub!( :exist? ).and_return( true )
|
46
|
-
@pkg.install_file( 'my_pkg' )
|
42
|
+
@pkg.install_file( 'my_pkg' )
|
47
43
|
end
|
48
44
|
|
49
45
|
it "#install_file should throw an error if the file does not exist" do
|
50
|
-
@pkg.stub!( :run_command )
|
51
46
|
File.stub!( :exist? ).and_return( false )
|
52
47
|
lambda do
|
53
48
|
@pkg.install_file( 'my_pkg' )
|
54
49
|
end.should raise_error( StandardError, /does not exist/ )
|
55
50
|
end
|
56
51
|
|
57
|
-
it "#uninstall should
|
58
|
-
|
59
|
-
@pkg.
|
60
|
-
@pkg.uninstall( 'pkg' ).should be_true
|
52
|
+
it "#uninstall should replace the current process via exec" do
|
53
|
+
@pkg.should_receive( :exec )
|
54
|
+
@pkg.uninstall( 'pkg' )
|
61
55
|
end
|
62
56
|
|
63
57
|
it "#provides should return a String" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: package_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joe Yates
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-01 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|