finnlabs-ci_reporter 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ci/reporter/rspec.rb +5 -5
- data/lib/ci/reporter/version.rb +1 -1
- data/spec/ci/reporter/rspec_spec.rb +22 -0
- metadata +3 -3
data/lib/ci/reporter/rspec.rb
CHANGED
@@ -156,15 +156,15 @@ module CI
|
|
156
156
|
|
157
157
|
private
|
158
158
|
def description_for(name_or_example)
|
159
|
+
name = "UNKOWN"
|
159
160
|
if name_or_example.respond_to?(:full_description)
|
160
|
-
name_or_example.full_description
|
161
|
+
name = name_or_example.full_description
|
161
162
|
elsif name_or_example.respond_to?(:metadata)
|
162
|
-
name_or_example.metadata[:example_group][:full_description]
|
163
|
+
name = name_or_example.metadata[:example_group][:full_description]
|
163
164
|
elsif name_or_example.respond_to?(:description)
|
164
|
-
name_or_example.description
|
165
|
-
else
|
166
|
-
"UNKNOWN"
|
165
|
+
name = name_or_example.description
|
167
166
|
end
|
167
|
+
name.gsub('?', '')
|
168
168
|
end
|
169
169
|
|
170
170
|
def write_report
|
data/lib/ci/reporter/version.rb
CHANGED
@@ -107,6 +107,28 @@ describe "The RSpec reporter" do
|
|
107
107
|
@fmt.dump_summary(0.1, 1, 0, 0)
|
108
108
|
end
|
109
109
|
|
110
|
+
it "should remove dangerous question marks from the name" do
|
111
|
+
group = mock "example group"
|
112
|
+
group.stub!(:description).and_return "group description"
|
113
|
+
example = mock "example"
|
114
|
+
example.stub!(:description).and_return "should do something?"
|
115
|
+
|
116
|
+
@formatter.should_receive(:start)
|
117
|
+
@formatter.should_receive(:example_group_started).with(group)
|
118
|
+
@formatter.should_receive(:example_started).with(example).once
|
119
|
+
@formatter.should_receive(:example_passed).once
|
120
|
+
@formatter.should_receive(:dump_summary)
|
121
|
+
@report_mgr.should_receive(:write_report).and_return do |suite|
|
122
|
+
suite.testcases.last.name.should == "should do something"
|
123
|
+
end
|
124
|
+
|
125
|
+
@fmt.start(2)
|
126
|
+
@fmt.example_group_started(group)
|
127
|
+
@fmt.example_started(example)
|
128
|
+
@fmt.example_passed(example)
|
129
|
+
@fmt.dump_summary(0.1, 1, 0, 0)
|
130
|
+
end
|
131
|
+
|
110
132
|
it "should create a test suite with failure in before(:all)" do
|
111
133
|
example_group = mock "example group"
|
112
134
|
example_group.stub!(:description).and_return "A context"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finnlabs-ci_reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 1.6.
|
9
|
+
- 6
|
10
|
+
version: 1.6.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nick Sieger
|