File tree Expand file tree Collapse file tree 3 files changed +30
-12
lines changed
Expand file tree Collapse file tree 3 files changed +30
-12
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,28 @@ Feature: Running A Deploy Hook
8888 | before_restart |
8989 | after_restart |
9090 | after_deploy |
91- #Scenario Outline: Running a callback with an Executable deploy hook
92- #Given the george app has a <Callback Name> executable hook
93- #When I run `engineyard-serverside hook <Callback Name>`
9491
95- #Scenario: Running a callback with both Ruby and Executable deploy hooks
92+ Scenario Outline : Running a callback with both Ruby and Executable deploy hooks
93+ Given my app has a <Callback Name> executable deploy hook
94+ Given my app has a <Callback Name> ruby deploy hook
95+ When I run the <Callback Name> callback
96+ Then the <Callback Name> ruby deploy hook is executed
97+ But the <Callback Name> executable deploy hook is not executed
9698
99+ Examples :
100+ | Callback Name |
101+ | before_deploy |
102+ | before_bundle |
103+ | after_bundle |
104+ | before_compile_assets |
105+ | after_compile_assets |
106+ | before_migrate |
107+ | after_migrate |
108+ | before_symlink |
109+ | after_symlink |
110+ | before_restart |
111+ | after_restart |
112+ | after_deploy |
97113 #Scenario: Running a callback with a Ruby service hook
98114
99115 #Scenario: Running a callback with an Executable service hook
Original file line number Diff line number Diff line change @@ -77,13 +77,11 @@ def framework_env
7777end
7878
7979Then %r{^the (.+) executable deploy hook is executed$} do |callback_name |
80- found = ExecutedCommands .
81- executed .
82- select { |x |
83- x . match ( /engineyard-serverside-execute-hook #{ callback_name } / )
84- } . length > 0
80+ expect ( ExecutedCommands . deploy_hook_executed? ( callback_name ) ) . to eql ( true )
81+ end
8582
86- expect ( found ) . to eql ( true )
83+ Then %r{^the (.+) executable deploy hook is not executed$} do |callback_name |
84+ expect ( ExecutedCommands . deploy_hook_executed? ( callback_name ) ) . to eql ( false )
8785end
8886
8987Then %{I see the output} do
Original file line number Diff line number Diff line change @@ -16,9 +16,13 @@ def self.reset
1616 @executed = nil
1717 end
1818
19- def self . hook_executed? ( path )
20- executed . select { |x | x . match ( /#{ Regexp . escape ( path ) } / ) } . length > 0
19+ def self . deploy_hook_executed? ( callback_name )
20+ executed .
21+ select { |x |
22+ x . match ( %r{engineyard-serverside-execute-hook #{ callback_name } } )
23+ } . length > 0
2124 end
25+
2226end
2327
2428module Runner
You can’t perform that action at this time.
0 commit comments