84
84
self.runbzr('ignore a b c')
85
85
self.assertEquals(self.capture('unknowns'), 'd\n')
86
86
self.check_file_contents('.bzrignore', 'a\nb\nc\n')
88
def test_ignore_no_arguments(self):
89
"""'ignore' with no arguments returns an error"""
91
self.run_bzr_error(('bzr: ERROR: ignore requires at least one '
92
'NAME_PATTERN or --old-default-rules\n',),
95
def test_ignore_absolutes(self):
96
"""'ignore' with an absolute path returns an error"""
98
self.run_bzr_error(('bzr: ERROR: NAME_PATTERN should not '
99
'be an absolute path\n',),
88
102
def test_ignore_old_defaults(self):
89
103
out, err = self.run_bzr('ignore', '--old-default-rules')
90
104
self.assertContainsRe(out, 'CVS')
91
105
self.assertEqual('', err)
107
def test_ignore_directories(self):
108
"""ignoring a directory should ignore directory tree.
110
Also check that trailing slashes on directories are stripped.
113
self.build_tree(['dir1/', 'dir1/foo',
115
'dir3/', 'dir3/baz'])
116
self.runbzr('ignore dir1 dir2/')
117
self.check_file_contents('.bzrignore', 'dir1\ndir2\n')
118
self.assertEquals(self.capture('unknowns'), 'dir3\n')