mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 07:04:12 +00:00 
			
		
		
		
	#942: Add new git_branch_0v_to_dash_v rule
* fix fuckup `branch 0v` by... ...deleting branch `0v` and running `git branch -v` as the user intended * use quotes consistently * provide new solution implementation based on feedback on PR * rename files to more accurately reflect their more generic contents * update import statement to match new file name * update command name in README.md * separate out matching tests so the pattern is clear for those who add matches in the future
This commit is contained in:
		
							
								
								
									
										22
									
								
								tests/rules/test_git_branch_flag_0_to_flag_dash_v.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								tests/rules/test_git_branch_flag_0_to_flag_dash_v.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| import pytest | ||||
| from thefuck.rules.git_branch_flag_0_to_flag_dash_v import match, get_new_command | ||||
| from thefuck.types import Command | ||||
|  | ||||
|  | ||||
| @pytest.fixture | ||||
| def output(): | ||||
|     return "" | ||||
|  | ||||
|  | ||||
| def test_match_git_branch_0v(output): | ||||
|     assert match(Command('git branch 0v', output)) | ||||
|  | ||||
|  | ||||
| def test_matches_no__git_branch_0_anything(output): | ||||
|     assert not match(Command('git branch -v', '')) | ||||
|     assert not match(Command('ls', output)) | ||||
|  | ||||
|  | ||||
| def test_get_new_command(output): | ||||
|     assert get_new_command(Command('git branch 0v', output))\ | ||||
|         == 'git branch -D 0v && git branch -v' | ||||
		Reference in New Issue
	
	Block a user