67
67
self.assertEquals(self.capture('unknowns'), 'foo.blah\n')
68
68
self.runbzr('ignore *.blah')
69
69
self.assertEquals(self.capture('unknowns'), '')
70
self.assertEquals('*.blah\n', open('.bzrignore', 'rU').read())
70
self.check_file_contents('.bzrignore', '*.blah\n')
72
72
# 'ignore' works when then .bzrignore file already exists
73
73
file('garh', 'wt').write('garh')
74
74
self.assertEquals(self.capture('unknowns'), 'garh\n')
75
75
self.runbzr('ignore garh')
76
76
self.assertEquals(self.capture('unknowns'), '')
77
self.assertEquals(file('.bzrignore', 'rU').read(), '*.blah\ngarh\n')
77
self.check_file_contents('.bzrignore', '*.blah\ngarh\n')
79
def test_ignore_multiple_arguments(self):
80
"""'ignore' works with multiple arguments"""
82
self.build_tree(['a','b','c','d'])
83
self.assertEquals(self.capture('unknowns'), 'a\nb\nc\nd\n')
84
self.runbzr('ignore a b c')
85
self.assertEquals(self.capture('unknowns'), 'd\n')
86
self.check_file_contents('.bzrignore', 'a\nb\nc\n')
79
88
def test_ignore_old_defaults(self):
80
89
out, err = self.run_bzr('ignore', '--old-default-rules')