auser-poolparty 0.2.2 → 0.2.3

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.
Files changed (120) hide show
  1. data/Manifest.txt +201 -0
  2. data/PostInstall.txt +17 -0
  3. data/Rakefile +22 -1
  4. data/bin/cloud-add-keypair +0 -0
  5. data/bin/cloud-osxcopy +22 -0
  6. data/bin/cloud-provision +1 -0
  7. data/bin/cloud-start +17 -15
  8. data/bin/cloud-terminate +23 -0
  9. data/bin/pool-start +14 -14
  10. data/bin/pool-start-monitor +1 -0
  11. data/config/hoe.rb +114 -0
  12. data/config/requirements.rb +15 -0
  13. data/lib/poolparty.rb +1 -0
  14. data/lib/poolparty/base_packages/haproxy.rb +32 -31
  15. data/lib/poolparty/base_packages/heartbeat.rb +2 -2
  16. data/lib/poolparty/base_packages/poolparty.rb +9 -3
  17. data/lib/poolparty/base_packages/ruby.rb +10 -0
  18. data/lib/poolparty/core/proc.rb +5 -0
  19. data/lib/poolparty/core/string.rb +1 -1
  20. data/lib/poolparty/helpers/binary.rb +6 -5
  21. data/lib/poolparty/helpers/display.rb +11 -2
  22. data/lib/poolparty/helpers/optioner.rb +6 -3
  23. data/lib/poolparty/helpers/provisioner_base.rb +9 -7
  24. data/lib/poolparty/helpers/provisioners/master.rb +38 -4
  25. data/lib/poolparty/helpers/provisioners/slave.rb +2 -2
  26. data/lib/poolparty/modules/cloud_resourcer.rb +20 -3
  27. data/lib/poolparty/modules/definable_resource.rb +1 -1
  28. data/lib/poolparty/modules/method_missing_sugar.rb +12 -4
  29. data/lib/poolparty/modules/pretty_printer.rb +2 -1
  30. data/lib/poolparty/net/remote.rb +1 -1
  31. data/lib/poolparty/net/remote_bases/ec2.rb +13 -10
  32. data/lib/poolparty/net/remote_instance.rb +3 -2
  33. data/lib/poolparty/net/remoter.rb +33 -18
  34. data/lib/poolparty/net/remoter_base.rb +3 -3
  35. data/lib/poolparty/plugins/gem_package.rb +6 -29
  36. data/lib/poolparty/plugins/git.rb +22 -0
  37. data/lib/poolparty/pool/base.rb +7 -6
  38. data/lib/poolparty/pool/cloud.rb +34 -5
  39. data/lib/poolparty/pool/custom_resource.rb +4 -4
  40. data/lib/poolparty/pool/plugin.rb +13 -14
  41. data/lib/poolparty/pool/resource.rb +19 -10
  42. data/lib/poolparty/pool/resources/class_package.rb +10 -6
  43. data/lib/poolparty/pool/resources/conditional.rb +41 -0
  44. data/lib/poolparty/pool/resources/gem.rb +2 -2
  45. data/lib/poolparty/pool/script.rb +25 -2
  46. data/lib/poolparty/templates/haproxy.conf +1 -1
  47. data/lib/poolparty/templates/puppet.conf +4 -2
  48. data/lib/poolparty/version.rb +1 -1
  49. data/poolparty.gemspec +60 -0
  50. data/setup.rb +1585 -0
  51. data/spec/poolparty/base_packages/haproxy_spec.rb +13 -0
  52. data/spec/poolparty/base_packages/heartbeat_spec.rb +30 -0
  53. data/spec/poolparty/bin/console_spec.rb +80 -0
  54. data/spec/poolparty/core/array_spec.rb +26 -0
  55. data/spec/poolparty/core/float.rb +13 -0
  56. data/spec/poolparty/core/hash_spec.rb +63 -0
  57. data/spec/poolparty/core/kernel_spec.rb +24 -0
  58. data/spec/poolparty/core/module_spec.rb +15 -0
  59. data/spec/poolparty/core/object_spec.rb +40 -0
  60. data/spec/poolparty/core/string_spec.rb +152 -0
  61. data/spec/poolparty/core/time_spec.rb +52 -0
  62. data/spec/poolparty/helpers/binary_spec.rb +26 -0
  63. data/spec/poolparty/helpers/display_spec.rb +13 -0
  64. data/spec/poolparty/helpers/optioner_spec.rb +39 -0
  65. data/spec/poolparty/helpers/provisioner_base_spec.rb +121 -0
  66. data/spec/poolparty/helpers/provisioners/master_spec.rb +54 -0
  67. data/spec/poolparty/helpers/provisioners/slave_spec.rb +28 -0
  68. data/spec/poolparty/modules/cloud_resourcer_spec.rb +135 -0
  69. data/spec/poolparty/modules/configurable_spec.rb +26 -0
  70. data/spec/poolparty/modules/definable_resource.rb +9 -0
  71. data/spec/poolparty/modules/file_writer_spec.rb +49 -0
  72. data/spec/poolparty/modules/s3_string_spec.rb +15 -0
  73. data/spec/poolparty/net/remote_bases/ec2_spec.rb +92 -0
  74. data/spec/poolparty/net/remote_instance_spec.rb +70 -0
  75. data/spec/poolparty/net/remote_spec.rb +286 -0
  76. data/spec/poolparty/net/remoter_base_spec.rb +80 -0
  77. data/spec/poolparty/net/remoter_spec.rb +191 -0
  78. data/spec/poolparty/plugins/git_spec.rb +19 -0
  79. data/spec/poolparty/plugins/line_spec.rb +16 -0
  80. data/spec/poolparty/plugins/svn_spec.rb +16 -0
  81. data/spec/poolparty/pool/base_spec.rb +108 -0
  82. data/spec/poolparty/pool/cloud_spec.rb +299 -0
  83. data/spec/poolparty/pool/configurers/files/ruby_basic.rb +17 -0
  84. data/spec/poolparty/pool/configurers/files/ruby_plugins.rb +16 -0
  85. data/spec/poolparty/pool/configurers/ruby_spec.rb +58 -0
  86. data/spec/poolparty/pool/custom_resource_spec.rb +115 -0
  87. data/spec/poolparty/pool/example_spec.rb +112 -0
  88. data/spec/poolparty/pool/plugin_model_spec.rb +63 -0
  89. data/spec/poolparty/pool/plugin_spec.rb +85 -0
  90. data/spec/poolparty/pool/pool_spec.rb +83 -0
  91. data/spec/poolparty/pool/resource_spec.rb +224 -0
  92. data/spec/poolparty/pool/resources/class_package_spec.rb +84 -0
  93. data/spec/poolparty/pool/resources/conditional_spec.rb +38 -0
  94. data/spec/poolparty/pool/resources/cron_spec.rb +49 -0
  95. data/spec/poolparty/pool/resources/directory_spec.rb +40 -0
  96. data/spec/poolparty/pool/resources/exec_spec.rb +37 -0
  97. data/spec/poolparty/pool/resources/file_spec.rb +40 -0
  98. data/spec/poolparty/pool/resources/gem_spec.rb +16 -0
  99. data/spec/poolparty/pool/resources/host_spec.rb +28 -0
  100. data/spec/poolparty/pool/resources/package_spec.rb +44 -0
  101. data/spec/poolparty/pool/resources/remote_file_spec.rb +40 -0
  102. data/spec/poolparty/pool/resources/service_spec.rb +45 -0
  103. data/spec/poolparty/pool/resources/sshkey_spec.rb +48 -0
  104. data/spec/poolparty/pool/resources/variable_spec.rb +20 -0
  105. data/spec/poolparty/pool/script_spec.rb +51 -0
  106. data/spec/poolparty/pool/test_plugins/sshkey_test +2 -0
  107. data/spec/poolparty/pool/test_plugins/virtual_host_template.erb +0 -0
  108. data/spec/poolparty/pool/test_plugins/webserver.rb +46 -0
  109. data/spec/poolparty/poolparty_spec.rb +33 -0
  110. data/spec/poolparty/spec_helper.rb +120 -0
  111. data/test/test_generator_helper.rb +29 -0
  112. data/test/test_helper.rb +2 -0
  113. data/test/test_pool_spec_generator.rb +47 -0
  114. data/test/test_poolparty.rb +11 -0
  115. data/website/index.html +81 -0
  116. data/website/index.txt +72 -0
  117. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  118. data/website/stylesheets/screen.css +138 -0
  119. data/website/template.html.erb +48 -0
  120. metadata +178 -60
@@ -0,0 +1,17 @@
1
+ pool :poolpartyrb do
2
+ plugin_directory "docs_plugins"
3
+
4
+ cloud :app do
5
+
6
+ # Configuration
7
+ configure({ :maximum_instances => 1,:keypair => "name" })
8
+ minimum_instances 1
9
+
10
+ apache do
11
+ enable_php
12
+ site("poolpartyrb.com")
13
+ end
14
+
15
+ end
16
+
17
+ end
@@ -0,0 +1,16 @@
1
+ pool :poolpartyrb do
2
+
3
+ cloud :app do
4
+
5
+ apache do
6
+ enable_php
7
+
8
+ site({
9
+ :document_root => "/www/domain2",
10
+ :server_name => "domain2.com"
11
+ })
12
+ end
13
+
14
+ end
15
+
16
+ end
@@ -0,0 +1,58 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+ require File.dirname(__FILE__) + '/../test_plugins/webserver'
3
+
4
+ describe "Configurer" do
5
+ before(:each) do
6
+ reset!
7
+ @basic = read_file(File.join(File.dirname(__FILE__), "files", "ruby_basic.rb"))
8
+ Script.inflate @basic
9
+ @conf = Object.new
10
+ end
11
+ it "should not be nil" do
12
+ @conf.should_not be_nil
13
+ end
14
+
15
+ describe "with a spec file" do
16
+ before(:each) do
17
+ @s = Script.new
18
+ Script.stub!(:new).and_return(@s)
19
+ @basic = read_file(File.join(File.dirname(__FILE__), "files", "ruby_basic.rb"))
20
+ end
21
+ it "should load the basic example configure" do
22
+ @s.should_receive(:inflate).and_return true
23
+ end
24
+ it "should call inflate on the pools" do
25
+ @s.pools.each {|a,b| b.should_receive(:inflate).and_return true }
26
+ end
27
+ describe "pool" do
28
+ before(:each) do
29
+ Script.inflate @basic
30
+ @pool = pool(:poolpartyrb)
31
+ end
32
+ end
33
+ describe "clouds" do
34
+ before(:each) do
35
+ reset!
36
+ Script.inflate @basic
37
+ @cloud = pool(:poolpartyrb).cloud(:app)
38
+ end
39
+ it "should contain a list of the clouds within the pool (:app)" do
40
+ @cloud.should_not be_nil
41
+ end
42
+ it "should set the minimum instances on the :app cloud" do
43
+ @cloud.minimum_instances.should == 1
44
+ end
45
+ it "should set the maximum instances on the :app cloud" do
46
+ @cloud.maximum_instances.should == 1
47
+ end
48
+ it "should set the keypair name on the :app cloud too" do
49
+ @cloud.keypair.should == "name"
50
+ end
51
+ end
52
+
53
+ after do
54
+ Script.inflate @basic
55
+ end
56
+ end
57
+
58
+ end
@@ -0,0 +1,115 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ include PoolParty::Resources
4
+
5
+ describe "Custom Resource" do
6
+ before(:each) do
7
+ @cloud = cloud :name do; end
8
+ end
9
+ it "should provide custom_resource as a method" do
10
+ self.respond_to?(:define_resource).should == true
11
+ end
12
+ describe "defining" do
13
+ it "should not raise ResourceException if custom_function and custom_usage are defined" do
14
+ lambda {
15
+ define_resource(:rockstar) do
16
+ def has_a_line_in_file(line="line_in_file", file="file")
17
+ call_function "line(#{file}, #{line})"
18
+ end
19
+ custom_function <<-EOF
20
+ define line($file, $line, $ensure = 'present') {
21
+ case...
22
+ }
23
+ EOF
24
+ end
25
+ }.should_not raise_error
26
+ end
27
+ describe "define_resource" do
28
+ before(:each) do
29
+ define_resource(:rockstar) do
30
+ def has_a_line_in_file(line="line_in_file", file="file")
31
+ call_function "line(#{file}, #{line})"
32
+ end
33
+ custom_function <<-EOF
34
+ define line($file, $line, $ensure = 'present') {
35
+ case...
36
+ }
37
+ EOF
38
+ end
39
+ end
40
+ it "should create a custom resource available as a class" do
41
+ lambda {RockstarClass.new }.should_not raise_error
42
+ end
43
+ it "should add the method has_a_line_in_file to Resources" do
44
+ PoolParty::Resources.methods.include?("has_a_line_in_file").should == true
45
+ end
46
+ end
47
+ describe "printing" do
48
+ before do
49
+ reset_resources!
50
+ define_resource(:rockstar) do
51
+ def has_a_line_in_file(line="line_in_file", file="file")
52
+ call_function "line(#{file}, #{line})"
53
+ end
54
+ custom_function <<-EOF
55
+ define line($file, $line, $ensure = 'present') {
56
+ case...
57
+ }
58
+ EOF
59
+ end
60
+ @resource = RockstarClass.new
61
+ end
62
+ it "should not be nil after it is defined" do
63
+ @resource.should_not be_nil
64
+ end
65
+ it "should store the custom_function in the class" do
66
+ RockstarClass.custom_functions.select {|a| a if a =~ /define line/}.should_not be_empty
67
+ end
68
+ it "should allow for the has_a_line_in_file to be called from within a plugin" do
69
+ @resource.instance_eval do
70
+ has_a_line_in_file("hi", "filename")
71
+ end
72
+ @resource.resource(:call_function).to_string.should == "line(filename, hi)"
73
+ end
74
+ it "should be stored in an array" do
75
+ resource(:rockstar).class.should == Array
76
+ end
77
+ describe "call function" do
78
+ it "should have the class CallFunction available" do
79
+ lambda {PoolParty::Resources::CallFunction}.should_not raise_error
80
+ end
81
+ it "should create a new CallFunction instance when calling call_function with a string" do
82
+ PoolParty::Resources::CallFunction.should_receive(:new).and_return "bunk"
83
+ add_resource(:call_function, "line")
84
+ end
85
+ it "should create a call function in the function call array" do
86
+ add_resource(:call_function, @cloud, "heyyohey")
87
+ resource(:call_function).size.should == 1
88
+ end
89
+ describe "defining" do
90
+ it "should add the methods to the class through module_eval" do
91
+ PoolParty::Resources.should_receive(:module_eval).at_least(1)
92
+ define_resource :imarockstar2YEAH do
93
+ end
94
+ end
95
+ end
96
+
97
+ describe "within context" do
98
+ before(:each) do
99
+ cloud :apple do
100
+ has_line_in_file("hello", "messages")
101
+ brain_child("meee")
102
+ end
103
+ @cloud = cloud(:apple)
104
+ end
105
+ it "should have 1 resource (the line resource)" do
106
+ @cloud.resources.should_not be_empty
107
+ end
108
+ it "should have one call_function resource" do
109
+ @cloud.resource(:call_function).first.to_string.should =~ /line \{/
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,112 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require "open-uri"
3
+
4
+ describe "basic" do
5
+ before(:each) do
6
+ @example_dir = ::File.join(::File.dirname(__FILE__), "..", "..", "..", "examples")
7
+ reset!
8
+ PoolParty::Script.inflate open(@example_dir + "/basic.rb").read
9
+ end
10
+ it "should have one pool called :app" do
11
+ pool(:app).should_not be_nil
12
+ end
13
+ it "should have a cloud called :app" do
14
+ pool(:app).cloud(:app).should_not be_nil
15
+ end
16
+ it "should have a cloud called :db" do
17
+ pool(:app).cloud(:db).should_not be_nil
18
+ end
19
+ it "should set the minimum_instances on the cloud to 2 (overriding the pool options)" do
20
+ pool(:app).cloud(:app).minimum_instances.should == 2
21
+ end
22
+ it "should set the maximum_instances on the cloud to 5" do
23
+ pool(:app).cloud(:app).maximum_instances.should == 5
24
+ end
25
+ it "should set the minimum_instances on the db cloud to 3" do
26
+ pool(:app).cloud(:db).minimum_instances.should == 3
27
+ end
28
+ describe "with_apache_plugin" do
29
+ before(:each) do
30
+ reset!
31
+ PoolParty::Script.inflate(open(@example_dir + "/with_apache_plugin.rb").read, File.dirname(__FILE__))
32
+ end
33
+ it "should have one pool called :app" do
34
+ pool(:app).should_not be_nil
35
+ end
36
+ it "should have a cloud called :app" do
37
+ pool(:app).cloud(:app).should_not be_nil
38
+ end
39
+ it "should have a cloud called :db" do
40
+ pool(:app).cloud(:db).should_not be_nil
41
+ end
42
+ it "should set the minimum_instances on the cloud to 2 (overriding the pool options)" do
43
+ pool(:app).cloud(:app).minimum_instances.should == 2
44
+ end
45
+ it "should set the maximum_instances on the cloud to 10" do
46
+ pool(:app).cloud(:app).maximum_instances.should == 10
47
+ end
48
+ it "should set the minimum_instances on the db cloud to 2" do
49
+ pool(:app).cloud(:db).minimum_instances.should == 2
50
+ end
51
+ it "should have included the apache plugin and given the class a method by the name of the plugin" do
52
+ pool(:app).cloud(:app).methods.include?("apache").should == true
53
+ end
54
+ describe "apache plugin" do
55
+ before(:each) do
56
+ @c = pool(:app).cloud(:app)
57
+ end
58
+ it "should have apache as the ApacheClass" do
59
+ @c.apache.class.should == PoolPartyApacheClass
60
+ end
61
+ it "should set php == true on the apache plugin" do
62
+ @c.apache.php.should == true
63
+ end
64
+ it "should store the method in options if it's not defined on the plugin" do
65
+ @c.enable_asp true
66
+ @c.options[:enable_asp].should == true
67
+ end
68
+ end
69
+ end
70
+ describe "plugin_without_plugin_directory" do
71
+ before(:each) do
72
+ reset!
73
+ PoolParty::Script.inflate(open(@example_dir + "/plugin_without_plugin_directory.rb").read, File.dirname(__FILE__))
74
+ end
75
+ it "should have one pool called :app" do
76
+ pool(:app).should_not be_nil
77
+ end
78
+ it "should have a cloud called :app" do
79
+ pool(:app).cloud(:app).should_not be_nil
80
+ end
81
+ it "should have a cloud called :db" do
82
+ pool(:app).cloud(:db).should_not be_nil
83
+ end
84
+ it "should set the minimum_instances on the cloud to 2 (overriding the pool options)" do
85
+ pool(:app).cloud(:app).minimum_instances.should == 2
86
+ end
87
+ it "should set the maximum_instances on the cloud to 10" do
88
+ pool(:app).cloud(:app).maximum_instances.should == 10
89
+ end
90
+ it "should set the minimum_instances on the db cloud to 2" do
91
+ pool(:app).cloud(:db).minimum_instances.should == 2
92
+ end
93
+ it "should have included the apache plugin and given the class a method by the name of the plugin" do
94
+ pool(:app).cloud(:app).methods.include?("apache").should == true
95
+ end
96
+ describe "apache plugin" do
97
+ before(:each) do
98
+ @c = pool(:app).cloud(:app)
99
+ end
100
+ it "should have apache as the ApacheClass" do
101
+ @c.apache.class.should == PoolPartyApacheClass
102
+ end
103
+ it "should set php == true on the apache plugin" do
104
+ @c.apache.php.should == true
105
+ end
106
+ it "should store the method in options if it's not defined on the plugin" do
107
+ @c.enable_asp true
108
+ @c.options[:enable_asp].should == true
109
+ end
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,63 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require File.dirname(__FILE__) + '/test_plugins/webserver'
3
+
4
+ describe "Plugin" do
5
+ before(:each) do
6
+ @p = pool :poolpartyrb do
7
+ cloud :app do
8
+ apache do
9
+ enable_php
10
+ site("heady", {
11
+ :document_root => "/root"
12
+ })
13
+ end
14
+ end
15
+ end
16
+ @c = @p.cloud(:app)
17
+ end
18
+ describe "methods should include" do
19
+ it "register_plugin(plugin)" do;WebServers.respond_to?(:register_plugin).should == true;end
20
+ end
21
+ describe "registered" do
22
+ before(:each) do
23
+ @plugin = "apache".class_constant.new(@c)
24
+ end
25
+ describe "storage" do
26
+ it "should store the plugin in a Hash on the pool" do
27
+ @c.plugins.class.should == Hash
28
+ end
29
+ it "should be able to retrieve the plugin as a name" do
30
+ @c.plugin("apache").should_not be_nil
31
+ end
32
+ end
33
+ it "should store the regsitered plugins in an array" do
34
+ @plugin.should_not be_nil
35
+ end
36
+ it "should set the pool on the plugin" do
37
+ @plugin.parent.should == @c
38
+ end
39
+ it "should have the plugin name as a method on the cloud " do
40
+ @c.respond_to?(:apache).should == true
41
+ end
42
+ describe "methods" do
43
+ before(:each) do
44
+ reset!
45
+ end
46
+ it "should call the enable_php method when in the defininition of the cloud" do
47
+ @plugin.respond_to?(:enable_php).should == true
48
+ end
49
+ it "should call php = true in the enable_php" do
50
+ @plugin.php.should_not == true
51
+ @plugin.enable_php
52
+ @plugin.php.should == true
53
+ end
54
+ it "should call the site method when in the defininition of the cloud" do
55
+ @plugin.respond_to?(:site).should == true
56
+ end
57
+ it "should be able to call the plugin method site" do
58
+ @plugin.should_receive(:virtual_host).once
59
+ @plugin.site("hi", {:document_root => "/root"})
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,85 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require File.dirname(__FILE__) + '/test_plugins/webserver'
3
+
4
+ describe "Plugin" do
5
+
6
+ before(:each) do
7
+ reset!
8
+ pool :poolpartyrb do
9
+ cloud :app do
10
+ apache do
11
+ enable_php
12
+ site("heady", {
13
+ :document_root => "/root"
14
+ })
15
+ end
16
+ end
17
+ end
18
+ @p = pool :poolpartyrb
19
+ @c = @p.cloud(:app)
20
+ end
21
+
22
+ it "should allow access to the pool on the cloud" do
23
+ @c.parent.should == @p
24
+ end
25
+ describe "instance" do
26
+ before(:each) do
27
+ @plugin = "apache".class_constant.new(@c)
28
+ end
29
+ it "should not be empty" do
30
+ @plugin.class.should == PoolPartyApacheClass
31
+ end
32
+ it "should have access to the cloud's container" do
33
+ @plugin.parent.should == @c
34
+ end
35
+ it "should have enable_php as a method" do
36
+ @plugin.respond_to?(:enable_php).should == true
37
+ end
38
+ describe "after eval'ing" do
39
+ before(:each) do
40
+ @plugin.instance_eval do
41
+ enable_php
42
+ has_gem(:name => "aska")
43
+ end
44
+ end
45
+ it "should call enable_php on the class" do
46
+ @plugin.php.should == true
47
+ end
48
+ it "should have resources attached to it" do
49
+ @plugin.resources.class.should == Hash
50
+ end
51
+ it "should have an array of gem resources" do
52
+ @plugin.resource(:package).class.should == Array
53
+ end
54
+ it "should have 1 gem in the resources defined" do
55
+ @plugin.resource(:package).size.should == 1
56
+ end
57
+ it "should have the gem named aska in the gem resource" do
58
+ @plugin.resource(:package).first.name.should == "aska"
59
+ end
60
+ it "should have its resources visible to its parent" do
61
+ @plugin.parent = @c
62
+ @c.resources
63
+ end
64
+ end
65
+ describe "before eval'ing" do
66
+ before(:each) do
67
+ reset!
68
+ @plugin = "apache".class_constant.new(@c)
69
+ end
70
+ it "should call has_line_in_file" do
71
+ @plugin.should_receive(:php).and_return true
72
+ end
73
+ it "should call site" do
74
+ @plugin.should_receive(:site).with("frank").and_return true
75
+ end
76
+ after do
77
+ @plugin.instance_eval do
78
+ enable_php
79
+ site("frank")
80
+ end
81
+ end
82
+
83
+ end
84
+ end
85
+ end