summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/runner/tag_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/spec/runner/tag_spec.rb')
-rw-r--r--spec/mspec/spec/runner/tag_spec.rb96
1 files changed, 48 insertions, 48 deletions
diff --git a/spec/mspec/spec/runner/tag_spec.rb b/spec/mspec/spec/runner/tag_spec.rb
index db55a1b186..bda9ac4280 100644
--- a/spec/mspec/spec/runner/tag_spec.rb
+++ b/spec/mspec/spec/runner/tag_spec.rb
@@ -1,123 +1,123 @@
require 'spec_helper'
require 'mspec/runner/tag'
-describe SpecTag do
+RSpec.describe SpecTag do
it "accepts an optional string to parse into fields" do
tag = SpecTag.new "tag(comment):description"
- tag.tag.should == "tag"
- tag.comment.should == "comment"
- tag.description.should == "description"
+ expect(tag.tag).to eq("tag")
+ expect(tag.comment).to eq("comment")
+ expect(tag.description).to eq("description")
end
end
-describe SpecTag, "#parse" do
+RSpec.describe SpecTag, "#parse" do
before :each do
@tag = SpecTag.new
end
it "accepts 'tag(comment):description'" do
@tag.parse "tag(I'm real):Some#method returns a value"
- @tag.tag.should == "tag"
- @tag.comment.should == "I'm real"
- @tag.description.should == "Some#method returns a value"
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq("I'm real")
+ expect(@tag.description).to eq("Some#method returns a value")
end
it "accepts 'tag:description'" do
@tag.parse "tag:Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == nil
- @tag.description.should == "Another#method"
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq(nil)
+ expect(@tag.description).to eq("Another#method")
end
it "accepts 'tag():description'" do
@tag.parse "tag():Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == nil
- @tag.description.should == "Another#method"
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq(nil)
+ expect(@tag.description).to eq("Another#method")
end
it "accepts 'tag:'" do
@tag.parse "tag:"
- @tag.tag.should == "tag"
- @tag.comment.should == nil
- @tag.description.should == ""
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq(nil)
+ expect(@tag.description).to eq("")
end
it "accepts 'tag(bug:555):Another#method'" do
@tag.parse "tag(bug:555):Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == "bug:555"
- @tag.description.should == "Another#method"
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq("bug:555")
+ expect(@tag.description).to eq("Another#method")
end
it "accepts 'tag(http://someplace.com/neato):Another#method'" do
@tag.parse "tag(http://someplace.com/neato):Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == "http://someplace.com/neato"
- @tag.description.should == "Another#method"
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq("http://someplace.com/neato")
+ expect(@tag.description).to eq("Another#method")
end
it "accepts 'tag(comment):\"Multi-line\\ntext\"'" do
@tag.parse 'tag(comment):"Multi-line\ntext"'
- @tag.tag.should == "tag"
- @tag.comment.should == "comment"
- @tag.description.should == "Multi-line\ntext"
+ expect(@tag.tag).to eq("tag")
+ expect(@tag.comment).to eq("comment")
+ expect(@tag.description).to eq("Multi-line\ntext")
end
it "ignores '#anything'" do
@tag.parse "# this could be a comment"
- @tag.tag.should == nil
- @tag.comment.should == nil
- @tag.description.should == nil
+ expect(@tag.tag).to eq(nil)
+ expect(@tag.comment).to eq(nil)
+ expect(@tag.description).to eq(nil)
end
end
-describe SpecTag, "#to_s" do
+RSpec.describe SpecTag, "#to_s" do
it "formats itself as 'tag(comment):description'" do
txt = "tag(comment):description"
tag = SpecTag.new txt
- tag.tag.should == "tag"
- tag.comment.should == "comment"
- tag.description.should == "description"
- tag.to_s.should == txt
+ expect(tag.tag).to eq("tag")
+ expect(tag.comment).to eq("comment")
+ expect(tag.description).to eq("description")
+ expect(tag.to_s).to eq(txt)
end
it "formats itself as 'tag:description" do
txt = "tag:description"
tag = SpecTag.new txt
- tag.tag.should == "tag"
- tag.comment.should == nil
- tag.description.should == "description"
- tag.to_s.should == txt
+ expect(tag.tag).to eq("tag")
+ expect(tag.comment).to eq(nil)
+ expect(tag.description).to eq("description")
+ expect(tag.to_s).to eq(txt)
end
it "formats itself as 'tag(comment):\"multi-line\\ntext\\ntag\"'" do
txt = 'tag(comment):"multi-line\ntext\ntag"'
tag = SpecTag.new txt
- tag.tag.should == "tag"
- tag.comment.should == "comment"
- tag.description.should == "multi-line\ntext\ntag"
- tag.to_s.should == txt
+ expect(tag.tag).to eq("tag")
+ expect(tag.comment).to eq("comment")
+ expect(tag.description).to eq("multi-line\ntext\ntag")
+ expect(tag.to_s).to eq(txt)
end
end
-describe SpecTag, "#==" do
+RSpec.describe SpecTag, "#==" do
it "returns true if the tags have the same fields" do
one = SpecTag.new "tag(this):unicorn"
two = SpecTag.new "tag(this):unicorn"
- one.==(two).should == true
- [one].==([two]).should == true
+ expect(one.==(two)).to eq(true)
+ expect([one].==([two])).to eq(true)
end
end
-describe SpecTag, "#unescape" do
+RSpec.describe SpecTag, "#unescape" do
it "replaces \\n by LF when the description is quoted" do
tag = SpecTag.new 'tag:"desc with\nnew line"'
- tag.description.should == "desc with\nnew line"
+ expect(tag.description).to eq("desc with\nnew line")
end
it "does not replaces \\n by LF when the description is not quoted " do
tag = SpecTag.new 'tag:desc with\nnew line'
- tag.description.should == "desc with\\nnew line"
+ expect(tag.description).to eq("desc with\\nnew line")
end
end