File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
test/instance_agent/plugins/codedeploy Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,30 @@ def make_app_spec
113113 end
114114 end
115115
116+ context "With sudo hook" do
117+ setup do
118+ #A single test script with all parameters
119+ @app_spec_string = <<-END
120+ version: 0.0
121+ os: linux
122+ hooks:
123+ test_hook:
124+ - location: test_location_1
125+ sudo: true
126+ runas: foo
127+ timeout: 30
128+ END
129+ end
130+ should "Return a collection containing test script 1" do
131+ app_spec = make_app_spec
132+ assert_not_equal nil , app_spec . hooks
133+ assert_equal [ 'test_location_1' ] , app_spec . hooks [ "test_hook" ] . map ( &:location )
134+ assert_equal [ true ] , app_spec . hooks [ "test_hook" ] . map ( &:sudo )
135+ assert_equal [ 'foo' ] , app_spec . hooks [ "test_hook" ] . map ( &:runas )
136+ assert_equal [ 30 ] , app_spec . hooks [ "test_hook" ] . map ( &:timeout )
137+ end
138+ end
139+
116140 context "With two complete hooks" do
117141 setup do
118142 #A pair of test scripts with all parameters
You can’t perform that action at this time.
0 commit comments