mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Merge Bundler 2.1.0.pre.1 as developed version from upstream.
a53709556b
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080eThis commit is contained in:
		
							parent
							
								
									d636809c05
								
							
						
					
					
						commit
						68ddd4d300
					
				
					 290 changed files with 5820 additions and 6161 deletions
				
			
		
							
								
								
									
										60
									
								
								spec/bundler/plugins/list_spec.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								spec/bundler/plugins/list_spec.rb
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,60 @@ | |||
| # frozen_string_literal: true | ||||
| 
 | ||||
| RSpec.describe "bundler plugin list" do | ||||
|   before do | ||||
|     build_repo2 do | ||||
|       build_plugin "foo" do |s| | ||||
|         s.write "plugins.rb", <<-RUBY | ||||
|           class Foo < Bundler::Plugin::API | ||||
|             command "shout" | ||||
| 
 | ||||
|             def exec(command, args) | ||||
|               puts "Foo shout" | ||||
|             end | ||||
|           end | ||||
|         RUBY | ||||
|       end | ||||
|       build_plugin "bar" do |s| | ||||
|         s.write "plugins.rb", <<-RUBY | ||||
|           class Bar < Bundler::Plugin::API | ||||
|             command "scream" | ||||
| 
 | ||||
|             def exec(command, args) | ||||
|               puts "Bar scream" | ||||
|             end | ||||
|           end | ||||
|         RUBY | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   context "no plugins installed" do | ||||
|     it "shows proper no plugins installed message" do | ||||
|       bundle "plugin list" | ||||
| 
 | ||||
|       expect(out).to include("No plugins installed") | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   context "single plugin installed" do | ||||
|     it "shows plugin name with commands list" do | ||||
|       bundle "plugin install foo --source file://#{gem_repo2}" | ||||
|       plugin_should_be_installed("foo") | ||||
|       bundle "plugin list" | ||||
| 
 | ||||
|       expected_output = "foo\n-----\n  shout" | ||||
|       expect(out).to include(expected_output) | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   context "multiple plugins installed" do | ||||
|     it "shows plugin names with commands list" do | ||||
|       bundle "plugin install foo bar --source file://#{gem_repo2}" | ||||
|       plugin_should_be_installed("foo", "bar") | ||||
|       bundle "plugin list" | ||||
| 
 | ||||
|       expected_output = "foo\n-----\n  shout\n\nbar\n-----\n  scream" | ||||
|       expect(out).to include(expected_output) | ||||
|     end | ||||
|   end | ||||
| end | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 hsbt
						hsbt