Permalink
Browse files

Updated MSpec source to bc4483a3.

  • Loading branch information...
1 parent 83ab3fd commit 76a78a7f269e1821f948789cfd634f60fc00e716 Brian Ford committed Jan 27, 2009
@@ -293,7 +293,7 @@ def self.write_tag(tag)
# file if it is empty.
def self.delete_tag(tag)
deleted = false
- pattern = /#{tag.tag}.*#{Regexp.escape tag.description}/
+ pattern = /#{tag.tag}.*#{Regexp.escape(tag.escape(tag.description))}/
file = tags_file
if File.exist? file
lines = IO.readlines(file)
View
@@ -1,33 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %q{mspec}
- s.version = "1.5.0"
-
- s.specification_version = 2 if s.respond_to? :specification_version=
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brian Ford"]
- s.date = %q{2008-05-21}
- s.email = %q{bford@engineyard.com}
- s.has_rdoc = true
- s.extra_rdoc_files = %w[ README LICENSE ]
- s.executables = ["mkspec", "mspec", "mspec-ci", "mspec-run", "mspec-tag"]
- s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
- s.homepage = %q{http://rubyspec.org}
- s.rubyforge_project = 'http://rubyforge.org/projects/mspec'
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.1.1}
- s.summary = <<EOS
-MSpec is a specialized framework that is syntax-compatible
-with RSpec for basic things like describe, it blocks and
-before, after actions.
-
-MSpec contains additional features that assist in writing
-the RubySpecs used by multiple Ruby implementations. Also,
-MSpec attempts to use the simplest Ruby language features
-so that beginning Ruby implementations can run it.
-EOS
-
- s.rdoc_options << '--title' << 'MSpec Gem' <<
- '--main' << 'README' <<
- '--line-numbers'
-end
View
@@ -1,33 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %q{mspec}
- s.version = "1.5.1"
-
- s.specification_version = 2 if s.respond_to? :specification_version=
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brian Ford"]
- s.date = %q{2008-11-12}
- s.email = %q{bford@engineyard.com}
- s.has_rdoc = true
- s.extra_rdoc_files = %w[ README LICENSE ]
- s.executables = ["mkspec", "mspec", "mspec-ci", "mspec-run", "mspec-tag"]
- s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
- s.homepage = %q{http://rubyspec.org}
- s.rubyforge_project = 'http://rubyforge.org/projects/mspec'
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.1.1}
- s.summary = <<EOS
-MSpec is a specialized framework that is syntax-compatible
-with RSpec for basic things like describe, it blocks and
-before, after actions.
-
-MSpec contains additional features that assist in writing
-the RubySpecs used by multiple Ruby implementations. Also,
-MSpec attempts to use the simplest Ruby language features
-so that beginning Ruby implementations can run it.
-EOS
-
- s.rdoc_options << '--title' << 'MSpec Gem' <<
- '--main' << 'README' <<
- '--line-numbers'
-end
View
@@ -1,33 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %q{mspec}
- s.version = "1.5.3"
-
- s.specification_version = 2 if s.respond_to? :specification_version=
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brian Ford"]
- s.date = %q{2008-12-1}
- s.email = %q{bford@engineyard.com}
- s.has_rdoc = true
- s.extra_rdoc_files = %w[ README LICENSE ]
- s.executables = ["mkspec", "mspec", "mspec-ci", "mspec-run", "mspec-tag"]
- s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
- s.homepage = %q{http://rubyspec.org}
- s.rubyforge_project = 'http://rubyforge.org/projects/mspec'
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.1.1}
- s.summary = <<EOS
-MSpec is a specialized framework that is syntax-compatible
-with RSpec for basic things like describe, it blocks and
-before, after actions.
-
-MSpec contains additional features that assist in writing
-the RubySpecs used by multiple Ruby implementations. Also,
-MSpec attempts to use the simplest Ruby language features
-so that beginning Ruby implementations can run it.
-EOS
-
- s.rdoc_options << '--title' << 'MSpec Gem' <<
- '--main' << 'README' <<
- '--line-numbers'
-end
View
@@ -1,33 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %q{mspec}
- s.version = "1.5.4"
-
- s.specification_version = 2 if s.respond_to? :specification_version=
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brian Ford"]
- s.date = %q{2008-12-17}
- s.email = %q{bford@engineyard.com}
- s.has_rdoc = true
- s.extra_rdoc_files = %w[ README LICENSE ]
- s.executables = ["mkspec", "mspec", "mspec-ci", "mspec-run", "mspec-tag"]
- s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
- s.homepage = %q{http://rubyspec.org}
- s.rubyforge_project = 'http://rubyforge.org/projects/mspec'
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.1.1}
- s.summary = <<EOS
-MSpec is a specialized framework that is syntax-compatible
-with RSpec for basic things like describe, it blocks and
-before, after actions.
-
-MSpec contains additional features that assist in writing
-the RubySpecs used by multiple Ruby implementations. Also,
-MSpec attempts to use the simplest Ruby language features
-so that beginning Ruby implementations can run it.
-EOS
-
- s.rdoc_options << '--title' << 'MSpec Gem' <<
- '--main' << 'README' <<
- '--line-numbers'
-end
View
@@ -1,33 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %q{mspec}
- s.version = "1.5.5"
-
- s.specification_version = 2 if s.respond_to? :specification_version=
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brian Ford"]
- s.date = %q{2008-12-29}
- s.email = %q{bford@engineyard.com}
- s.has_rdoc = true
- s.extra_rdoc_files = %w[ README LICENSE ]
- s.executables = ["mkspec", "mspec", "mspec-ci", "mspec-run", "mspec-tag"]
- s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
- s.homepage = %q{http://rubyspec.org}
- s.rubyforge_project = 'http://rubyforge.org/projects/mspec'
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.1.1}
- s.summary = <<EOS
-MSpec is a specialized framework that is syntax-compatible
-with RSpec for basic things like describe, it blocks and
-before, after actions.
-
-MSpec contains additional features that assist in writing
-the RubySpecs used by multiple Ruby implementations. Also,
-MSpec attempts to use the simplest Ruby language features
-so that beginning Ruby implementations can run it.
-EOS
-
- s.rdoc_options << '--title' << 'MSpec Gem' <<
- '--main' << 'README' <<
- '--line-numbers'
-end
View
@@ -1,23 +1,66 @@
-diff --git a/lib/mspec/helpers/ruby_exe.rb b/lib/mspec/helpers/ruby_exe.rb
-index c803ddc..8e9ef94 100644
---- a/lib/mspec/helpers/ruby_exe.rb
-+++ b/lib/mspec/helpers/ruby_exe.rb
-@@ -91,14 +91,14 @@ class Object
+diff --git a/mspec/lib/mspec/runner/mspec.rb b/mspec/lib/mspec/runner/mspec.rb
+index f094da0..c48e568 100644
+--- a/mspec/lib/mspec/runner/mspec.rb
++++ b/mspec/lib/mspec/runner/mspec.rb
+@@ -293,7 +293,7 @@ module MSpec
+ # file if it is empty.
+ def self.delete_tag(tag)
+ deleted = false
+- pattern = /#{tag.tag}.*#{Regexp.escape tag.description}/
++ pattern = /#{tag.tag}.*#{Regexp.escape(tag.escape(tag.description))}/
+ file = tags_file
+ if File.exist? file
+ lines = IO.readlines(file)
+diff --git a/mspec/spec/runner/mspec_spec.rb b/mspec/spec/runner/mspec_spec.rb
+index a7ff4fd..b562d75 100644
+--- a/mspec/spec/runner/mspec_spec.rb
++++ b/mspec/spec/runner/mspec_spec.rb
+@@ -415,6 +415,7 @@ describe MSpec, ".write_tags" do
+ IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
+ incomplete(20%):The#best method ever
+ benchmark(0.01825):The#fastest method today
++extended():\"Multi-line\\ntext\\ntag\"
+ ]
+ MSpec.write_tags [@tag1, @tag2]
+ IO.read(tmp("tags.txt")).should == %[check(broken):Tag#rewrite works
+@@ -461,6 +462,15 @@ describe MSpec, ".delete_tag" do
+ MSpec.delete_tag(@tag).should == true
+ IO.read(tmp("tags.txt")).should == %[incomplete(20%):The#best method ever
+ benchmark(0.01825):The#fastest method today
++extended():\"Multi-line\\ntext\\ntag\"
++]
++ end
++
++ it "deletes a tag with escaped newlines" do
++ MSpec.delete_tag(SpecTag.new('extended:"Multi-line\ntext\ntag"')).should == true
++ IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
++incomplete(20%):The#best method ever
++benchmark(0.01825):The#fastest method today
+ ]
+ end
- def resolve_ruby_exe
- [:env, :engine, :name, :install_name].each do |option|
-- exe = ruby_exe_options option
-+ return unless cmd = ruby_exe_options(option)
-+ exe = cmd.split.first
+@@ -470,6 +480,7 @@ benchmark(0.01825):The#fastest method today
+ IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
+ incomplete(20%):The#best method ever
+ benchmark(0.01825):The#fastest method today
++extended():\"Multi-line\\ntext\\ntag\"
+ ]
+ end
- # It has been reported that File.executable is not reliable
- # on Windows platforms (see commit 56bc555c). So, we check the
- # platform.
-- if exe and File.exists?(exe) and
-- (SpecGuard.windows? || File.executable?(exe))
-- return exe
-+ if File.exists?(exe) and (SpecGuard.windows? || File.executable?(exe))
-+ return cmd
- end
- end
- nil
+@@ -477,6 +488,7 @@ benchmark(0.01825):The#fastest method today
+ MSpec.delete_tag(@tag).should == true
+ MSpec.delete_tag(SpecTag.new("incomplete:The#best method ever")).should == true
+ MSpec.delete_tag(SpecTag.new("benchmark:The#fastest method today")).should == true
++ MSpec.delete_tag(SpecTag.new("extended:\"Multi-line\ntext\ntag\"")).should == true
+ File.exist?(tmp("tags.txt")).should == false
+ end
+ end
+diff --git a/mspec/spec/runner/tags.txt b/mspec/spec/runner/tags.txt
+index 5e39ee5..f4eb6ad 100644
+--- a/mspec/spec/runner/tags.txt
++++ b/mspec/spec/runner/tags.txt
+@@ -1,3 +1,4 @@
+ fail(broken):Some#method? works
+ incomplete(20%):The#best method ever
+ benchmark(0.01825):The#fastest method today
++extended():"Multi-line\ntext\ntag"
@@ -415,6 +415,7 @@
IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
incomplete(20%):The#best method ever
benchmark(0.01825):The#fastest method today
+extended():\"Multi-line\\ntext\\ntag\"
]
MSpec.write_tags [@tag1, @tag2]
IO.read(tmp("tags.txt")).should == %[check(broken):Tag#rewrite works
@@ -461,6 +462,15 @@
MSpec.delete_tag(@tag).should == true
IO.read(tmp("tags.txt")).should == %[incomplete(20%):The#best method ever
benchmark(0.01825):The#fastest method today
+extended():\"Multi-line\\ntext\\ntag\"
+]
+ end
+
+ it "deletes a tag with escaped newlines" do
+ MSpec.delete_tag(SpecTag.new('extended:"Multi-line\ntext\ntag"')).should == true
+ IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
+incomplete(20%):The#best method ever
+benchmark(0.01825):The#fastest method today
]
end
@@ -470,13 +480,15 @@
IO.read(tmp("tags.txt")).should == %[fail(broken):Some#method? works
incomplete(20%):The#best method ever
benchmark(0.01825):The#fastest method today
+extended():\"Multi-line\\ntext\\ntag\"
]
end
it "deletes the tag file if it is empty" do
MSpec.delete_tag(@tag).should == true
MSpec.delete_tag(SpecTag.new("incomplete:The#best method ever")).should == true
MSpec.delete_tag(SpecTag.new("benchmark:The#fastest method today")).should == true
+ MSpec.delete_tag(SpecTag.new("extended:\"Multi-line\ntext\ntag\"")).should == true
File.exist?(tmp("tags.txt")).should == false
end
end
@@ -1,3 +1,4 @@
fail(broken):Some#method? works
incomplete(20%):The#best method ever
benchmark(0.01825):The#fastest method today
+extended():"Multi-line\ntext\ntag"

0 comments on commit 76a78a7

Please sign in to comment.