allure-rspec 0.6.3 → 0.6.4
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/allure-rspec/formatter.rb +29 -32
- data/lib/allure-rspec/version.rb +1 -1
- data/spec/extend_steps_spec.rb +20 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f5395116359bfd7bf306159077438a646322706
|
4
|
+
data.tar.gz: 77e31a2c0462029ab44e36692aa89dffa470d917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75486c8ecf8b9c0db5bdfa0d91bf1ee6dcefff77d9b756f1ee8f1f8670c3ec95f78e2fbaca461d65e54b0ae7bba320c386cde0a45db213500587b369e1b2ca07
|
7
|
+
data.tar.gz: 45fb36c869f2fc088203fc1c300cb2ca55c713c99f9d3ec1af9ccdcb252c341cc62f07f93e1814d37ddb049e24f86bb093943ffab85888aa4b9608f344ee83f8
|
data/Gemfile.lock
CHANGED
@@ -9,48 +9,32 @@ module AllureRSpec
|
|
9
9
|
:example_failed, :example_passed, :example_pending, :start, :stop]
|
10
10
|
ALLOWED_LABELS = [:feature, :story, :severity, :language, :framework]
|
11
11
|
|
12
|
-
def example_failed(
|
13
|
-
res =
|
14
|
-
|
15
|
-
|
16
|
-
example.example.description.to_s,
|
17
|
-
{
|
18
|
-
:exception => res.exception,
|
19
|
-
:status => res.status,
|
20
|
-
:finished_at => res.finished_at,
|
21
|
-
:started_at => res.started_at
|
22
|
-
}
|
23
|
-
)
|
12
|
+
def example_failed(notification)
|
13
|
+
res = notification.example.execution_result
|
14
|
+
status = res.exception.is_a?(RSpec::Expectations::ExpectationNotMetError) ? :failed : :broken
|
15
|
+
stop_test(notification.example, :exception => res.exception, :status => status)
|
24
16
|
end
|
25
17
|
|
26
|
-
def example_group_finished(
|
27
|
-
AllureRubyAdaptorApi::Builder.stop_suite(
|
18
|
+
def example_group_finished(notification)
|
19
|
+
AllureRubyAdaptorApi::Builder.stop_suite(notification.group.description.to_s)
|
28
20
|
end
|
29
21
|
|
30
|
-
def example_group_started(
|
31
|
-
AllureRubyAdaptorApi::Builder.start_suite(
|
22
|
+
def example_group_started(notification)
|
23
|
+
AllureRubyAdaptorApi::Builder.start_suite(notification.group.description.to_s, labels(notification))
|
32
24
|
end
|
33
25
|
|
34
|
-
def example_passed(
|
35
|
-
|
36
|
-
AllureRubyAdaptorApi::Builder.stop_test(
|
37
|
-
example.example.example_group.description,
|
38
|
-
example.example.description.to_s,
|
39
|
-
{
|
40
|
-
:status => res.status,
|
41
|
-
:finished_at => res.finished_at,
|
42
|
-
:started_at => res.started_at
|
43
|
-
}
|
44
|
-
)
|
26
|
+
def example_passed(notification)
|
27
|
+
stop_test(notification.example)
|
45
28
|
end
|
46
29
|
|
47
|
-
def example_pending(
|
30
|
+
def example_pending(notification)
|
31
|
+
stop_test(notification.example)
|
48
32
|
end
|
49
33
|
|
50
|
-
def example_started(
|
51
|
-
suite =
|
52
|
-
test =
|
53
|
-
AllureRubyAdaptorApi::Builder.start_test(suite, test, labels(
|
34
|
+
def example_started(notification)
|
35
|
+
suite = notification.example.example_group.description
|
36
|
+
test = notification.example.description.to_s
|
37
|
+
AllureRubyAdaptorApi::Builder.start_test(suite, test, labels(notification))
|
54
38
|
end
|
55
39
|
|
56
40
|
def start(example_count)
|
@@ -68,6 +52,19 @@ module AllureRSpec
|
|
68
52
|
|
69
53
|
private
|
70
54
|
|
55
|
+
def stop_test(example, opts = {})
|
56
|
+
res = example.execution_result
|
57
|
+
AllureRubyAdaptorApi::Builder.stop_test(
|
58
|
+
example.example_group.description,
|
59
|
+
example.description.to_s,
|
60
|
+
{
|
61
|
+
:status => res.status,
|
62
|
+
:finished_at => res.finished_at,
|
63
|
+
:started_at => res.started_at
|
64
|
+
}.merge(opts)
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
71
68
|
def metadata(example_or_group)
|
72
69
|
(example_or_group.respond_to? :group) ?
|
73
70
|
example_or_group.group.metadata :
|
data/lib/allure-rspec/version.rb
CHANGED
data/spec/extend_steps_spec.rb
CHANGED
@@ -35,19 +35,34 @@ describe AllureRSpec, :feature => "Basics" do
|
|
35
35
|
puts "after all"
|
36
36
|
end
|
37
37
|
|
38
|
-
it "should build", :story => "Main story" do |
|
39
|
-
|
40
|
-
|
38
|
+
it "should build", :story => "Main story" do |e|
|
39
|
+
e.attach_file "test-file1", Tempfile.new("test")
|
40
|
+
e.step "step1" do |step|
|
41
41
|
step.attach_file "test-file2", Tempfile.new("test")
|
42
42
|
end
|
43
43
|
|
44
|
-
|
44
|
+
e.step "step2" do |step|
|
45
45
|
step.attach_file "logo", File.new("logo.png")
|
46
46
|
expect(5).to be > 1
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
e.step "step3" do
|
50
50
|
expect(0).to be eql(1)
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
it "should raise exception" do |e|
|
55
|
+
|
56
|
+
e.step "step1" do
|
57
|
+
expect(5).to be > 1
|
58
|
+
end
|
59
|
+
|
60
|
+
e.step "step2" do
|
61
|
+
raise "Undesired exception"
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
it "is a pending example"
|
67
|
+
|
53
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Sadykov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -111,6 +111,6 @@ rubyforge_project:
|
|
111
111
|
rubygems_version: 2.0.3
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
|
-
summary: allure-rspec-0.6.
|
114
|
+
summary: allure-rspec-0.6.4
|
115
115
|
test_files: []
|
116
116
|
has_rdoc:
|