@@ -89,18 +89,21 @@ def execute_and_signal(command, signal_type)
8989 end
9090
9191 context 'when run' do
92+ let ( :binstubs_error ) do
93+ Regexp . new ( <<~'END_BINSTUBS_ERROR' )
94+ The \`puppet\` executable in the \`(?:openvox|puppet)\` gem is being loaded, but it's also present in other gems \((?:openvox|puppet)\)\.
95+ If you meant to run the executable for another gem, make sure you use a project specific binstub \(\`bundle binstub <gem_name>\`\)\.
96+ If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names\.
97+ END_BINSTUBS_ERROR
98+ end
99+
92100 it 'handles lack of command line arguments' do
93101 results = execute ( simp_exe )
94102 warn ( "=== stderr: #{ results [ :stderr ] } " ) unless ( results [ :stderr ] ) . empty?
95103 warn ( "=== stdout: #{ results [ :stdout ] } " ) unless ( results [ :stdout ] ) . empty?
96104 expect ( results [ :exitstatus ] ) . to eq 0
97105 expect ( results [ :stdout ] ) . to match ( /SIMP Command Line Interface/ )
98106 # expect(results[:stderr]).to be_empty
99- binstubs_error = <<~END_BINSTUBS_ERROR
100- The `puppet` executable in the `openvox` gem is being loaded, but it's also present in other gems (puppet).
101- If you meant to run the executable for another gem, make sure you use a project specific binstub (`bundle binstub <gem_name>`).
102- If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names.
103- END_BINSTUBS_ERROR
104107 stderr_without_binstubs_error = results [ :stderr ] . gsub ( binstubs_error , '' )
105108 expect ( stderr_without_binstubs_error . strip ) . to be_empty
106109 end
@@ -110,11 +113,6 @@ def execute_and_signal(command, signal_type)
110113 expect ( results [ :exitstatus ] ) . to eq 0
111114 expect ( results [ :stdout ] ) . to match ( /=== The SIMP Configuration Tool ===/ )
112115 # expect(results[:stderr]).to be_empty
113- binstubs_error = <<~END_BINSTUBS_ERROR
114- The `puppet` executable in the `openvox` gem is being loaded, but it's also present in other gems (puppet).
115- If you meant to run the executable for another gem, make sure you use a project specific binstub (`bundle binstub <gem_name>`).
116- If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names.
117- END_BINSTUBS_ERROR
118116 stderr_without_binstubs_error = results [ :stderr ] . gsub ( binstubs_error , '' )
119117 expect ( stderr_without_binstubs_error . strip ) . to be_empty
120118 end
0 commit comments