summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/integration/tag_spec.rb
blob: d980769043a9b96c8af0a9a91e8fdcf66b9303e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# encoding: utf-8
require 'spec_helper'

describe "Running mspec tag" do
  before :all do
    FileUtils.rm_rf 'spec/fixtures/tags'
  end

  after :all do
    FileUtils.rm_rf 'spec/fixtures/tags'
  end

  it "tags the failing specs" do
    fixtures = "spec/fixtures"
    out, ret = run_mspec("tag", "--add fails --fail #{fixtures}/tagging_spec.rb")
    out.should == <<EOS
RUBY_DESCRIPTION
.FF
TagAction: specs tagged with 'fails':

Tag#me errors
Tag#me érròrs in unicode


1)
Tag#me errors FAILED
Expected 1
 to equal 2

CWD/spec/fixtures/tagging_spec.rb:9:in `block (2 levels) in <top (required)>'
CWD/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
CWD/bin/mspec-tag:7:in `<main>'

2)
Tag#me érròrs in unicode FAILED
Expected 1
 to equal 2

CWD/spec/fixtures/tagging_spec.rb:13:in `block (2 levels) in <top (required)>'
CWD/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
CWD/bin/mspec-tag:7:in `<main>'

Finished in D.DDDDDD seconds

1 file, 3 examples, 3 expectations, 2 failures, 0 errors, 0 tagged
EOS
    ret.success?.should == false
  end

  it "does not run already tagged specs" do
    fixtures = "spec/fixtures"
    out, ret = run_mspec("run", "--excl-tag fails #{fixtures}/tagging_spec.rb")
    out.should == <<EOS
RUBY_DESCRIPTION
.

Finished in D.DDDDDD seconds

1 file, 3 examples, 1 expectation, 0 failures, 0 errors, 2 tagged
EOS
    ret.success?.should == true
  end
end