Skip to content

Commit a2587d9

Browse files
eregonandrykonchin
authored andcommitted
Make MSpec.write_tags delete the file if writing 0 tags
* That way `mspec tag --purge` deletes files in a single run instead of 2 runs with the first leaving empty tag files.
1 parent e50fb3c commit a2587d9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/mspec/runner/mspec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ def self.make_tag_dir(path)
365365
# Writes each tag in +tags+ to the tag file. Overwrites the
366366
# tag file if it exists.
367367
def self.write_tags(tags)
368+
return delete_tags if tags.empty?
368369
file = tags_file
369370
make_tag_dir(file)
370371
File.open(file, "w:utf-8") do |f|

0 commit comments

Comments
 (0)