@@ -212,14 +212,42 @@ def exec(command, args)
212212 end
213213 end
214214
215- it "installs from a path source" do
216- build_lib "path_plugin" do |s |
217- s . write "plugins.rb"
215+ context "path plugins" do
216+ it "installs from a path source" do
217+ build_lib "path_plugin" do |s |
218+ s . write "plugins.rb"
219+ end
220+ bundle "plugin install path_plugin --path #{ lib_path ( "path_plugin-1.0" ) } "
221+
222+ expect ( out ) . to include ( "Installed plugin path_plugin" )
223+ plugin_should_be_installed ( "path_plugin" )
224+ end
225+
226+ it "installs from a relative path source" do
227+ build_lib "path_plugin" do |s |
228+ s . write "plugins.rb"
229+ end
230+ path = lib_path ( "path_plugin-1.0" ) . relative_path_from ( bundled_app )
231+ bundle "plugin install path_plugin --path #{ path } "
232+
233+ expect ( out ) . to include ( "Installed plugin path_plugin" )
234+ plugin_should_be_installed ( "path_plugin" )
218235 end
219- bundle "plugin install path_plugin --path #{ lib_path ( "path_plugin-1.0" ) } "
220236
221- expect ( out ) . to include ( "Installed plugin path_plugin" )
222- plugin_should_be_installed ( "path_plugin" )
237+ it "installs from a relative path source when inside an app" do
238+ allow ( Bundler ::SharedHelpers ) . to receive ( :find_gemfile ) . and_return ( bundled_app_gemfile )
239+ gemfile ""
240+
241+ build_lib "ga-plugin" do |s |
242+ s . write "plugins.rb"
243+ end
244+
245+ path = lib_path ( "ga-plugin-1.0" ) . relative_path_from ( bundled_app )
246+ bundle "plugin install ga-plugin --path #{ path } "
247+
248+ plugin_should_be_installed ( "ga-plugin" )
249+ expect ( local_plugin_gem ( "foo-1.0" ) ) . not_to be_directory
250+ end
223251 end
224252
225253 context "Gemfile eval" do
@@ -291,6 +319,21 @@ def exec(command, args)
291319 plugin_should_be_installed ( "ga-plugin" )
292320 end
293321
322+ it "accepts relative path sources" do
323+ build_lib "ga-plugin" do |s |
324+ s . write "plugins.rb"
325+ end
326+
327+ path = lib_path ( "ga-plugin-1.0" ) . relative_path_from ( bundled_app )
328+ install_gemfile <<-G
329+ source "#{ file_uri_for ( gem_repo1 ) } "
330+ plugin 'ga-plugin', :path => "#{ path } "
331+ G
332+
333+ expect ( out ) . to include ( "Installed plugin ga-plugin" )
334+ plugin_should_be_installed ( "ga-plugin" )
335+ end
336+
294337 context "in deployment mode" do
295338 it "installs plugins" do
296339 install_gemfile <<-G
0 commit comments