Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 67 lines (64 sloc) 2.671 kB
76a78a7 @brixen Updated MSpec source to bc4483a3.
brixen authored
1 diff --git a/mspec/lib/mspec/runner/mspec.rb b/mspec/lib/mspec/runner/mspec.rb
2 index f094da0..c48e568 100644
3 --- a/mspec/lib/mspec/runner/mspec.rb
4 +++ b/mspec/lib/mspec/runner/mspec.rb
5 @@ -293,7 +293,7 @@ module MSpec
6 # file if it is empty.
7 def self.delete_tag(tag)
8 deleted = false
9 - pattern = /#{tag.tag}.*#{Regexp.escape tag.description}/
10 + pattern = /#{tag.tag}.*#{Regexp.escape(tag.escape(tag.description))}/
11 file = tags_file
12 if File.exist? file
13 lines = IO.readlines(file)
14 diff --git a/mspec/spec/runner/mspec_spec.rb b/mspec/spec/runner/mspec_spec.rb
15 index a7ff4fd..b562d75 100644
16 --- a/mspec/spec/runner/mspec_spec.rb
17 +++ b/mspec/spec/runner/mspec_spec.rb
18 @@ -415,6 +415,7 @@ describe MSpec, ".write_tags" do
19 IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
20 incomplete(20%):The#best method ever
21 benchmark(0.01825):The#fastest method today
22 +extended():\"Multi-line\\ntext\\ntag\"
23 ]
24 MSpec.write_tags [@tag1, @tag2]
25 IO.read(tmp("tags.txt")).should == %[check(broken):Tag#rewrite works
26 @@ -461,6 +462,15 @@ describe MSpec, ".delete_tag" do
27 MSpec.delete_tag(@tag).should == true
28 IO.read(tmp("tags.txt")).should == %[incomplete(20%):The#best method ever
29 benchmark(0.01825):The#fastest method today
30 +extended():\"Multi-line\\ntext\\ntag\"
31 +]
32 + end
33 +
34 + it "deletes a tag with escaped newlines" do
35 + MSpec.delete_tag(SpecTag.new('extended:"Multi-line\ntext\ntag"')).should == true
36 + IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
37 +incomplete(20%):The#best method ever
38 +benchmark(0.01825):The#fastest method today
39 ]
40 end
e423a1a @brixen Updated MSpec source to c526c953.
brixen authored
41
76a78a7 @brixen Updated MSpec source to bc4483a3.
brixen authored
42 @@ -470,6 +480,7 @@ benchmark(0.01825):The#fastest method today
43 IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
44 incomplete(20%):The#best method ever
45 benchmark(0.01825):The#fastest method today
46 +extended():\"Multi-line\\ntext\\ntag\"
47 ]
48 end
e423a1a @brixen Updated MSpec source to c526c953.
brixen authored
49
76a78a7 @brixen Updated MSpec source to bc4483a3.
brixen authored
50 @@ -477,6 +488,7 @@ benchmark(0.01825):The#fastest method today
51 MSpec.delete_tag(@tag).should == true
52 MSpec.delete_tag(SpecTag.new("incomplete:The#best method ever")).should == true
53 MSpec.delete_tag(SpecTag.new("benchmark:The#fastest method today")).should == true
54 + MSpec.delete_tag(SpecTag.new("extended:\"Multi-line\ntext\ntag\"")).should == true
55 File.exist?(tmp("tags.txt")).should == false
56 end
57 end
58 diff --git a/mspec/spec/runner/tags.txt b/mspec/spec/runner/tags.txt
59 index 5e39ee5..f4eb6ad 100644
60 --- a/mspec/spec/runner/tags.txt
61 +++ b/mspec/spec/runner/tags.txt
62 @@ -1,3 +1,4 @@
63 fail(broken):Some#method? works
64 incomplete(20%):The#best method ever
65 benchmark(0.01825):The#fastest method today
66 +extended():"Multi-line\ntext\ntag"
Something went wrong with that request. Please try again.