allure-rspec 0.6.5 → 0.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/allure-rspec/dsl.rb +9 -4
- data/lib/allure-rspec/formatter.rb +12 -6
- data/lib/allure-rspec/version.rb +1 -1
- data/spec/extend_steps_spec.rb +8 -0
- data/spec/shared_example_spec.rb +34 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e65ce5bd4c4284c9468ffa80e38ba3d11fb78f6
|
4
|
+
data.tar.gz: a88e0b7709f0c4f81491d905cc828474dd4cea16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e40604de0297a49ca2cd648d4cd9cfa31a812a06ff11d870e46f4ba6c88b3af0ebcd620d9a980c73175907146f6ffb22df818a3249d76bc0b58a1fb148db070
|
7
|
+
data.tar.gz: ac482c8e6c63a682f986b7aaa048373954a2946ed694f1bbbd35a22feccb3b7f17e322f0098a0538941a074441b6c1d0dafb9dc8b09eb41bb3b50cf72e1aa2cd
|
data/Gemfile.lock
CHANGED
data/lib/allure-rspec/dsl.rb
CHANGED
@@ -13,8 +13,8 @@ module AllureRSpec
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def step(step, &block)
|
16
|
-
suite = metadata[:example_group]
|
17
|
-
test = metadata
|
16
|
+
suite = __description(metadata[:example_group])
|
17
|
+
test = __description(metadata)
|
18
18
|
begin
|
19
19
|
AllureRubyAdaptorApi::Builder.start_step(suite, test, step)
|
20
20
|
__with_step step, &block
|
@@ -25,15 +25,20 @@ module AllureRSpec
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
|
28
29
|
def attach_file(title, file, opts = {})
|
29
|
-
suite = metadata[:example_group]
|
30
|
-
test = metadata
|
30
|
+
suite = __description(metadata[:example_group])
|
31
|
+
test = __description(metadata)
|
31
32
|
step = current_step
|
32
33
|
AllureRubyAdaptorApi::Builder.add_attachment suite, test, opts.merge(:title => title, :file => file, :step => step)
|
33
34
|
end
|
34
35
|
|
35
36
|
private
|
36
37
|
|
38
|
+
def __description(data)
|
39
|
+
data[:full_description] || data[:description]
|
40
|
+
end
|
41
|
+
|
37
42
|
def __mutex
|
38
43
|
@@__mutex ||= Mutex.new
|
39
44
|
end
|
@@ -16,11 +16,11 @@ module AllureRSpec
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def example_group_finished(notification)
|
19
|
-
AllureRubyAdaptorApi::Builder.stop_suite(notification.group.
|
19
|
+
AllureRubyAdaptorApi::Builder.stop_suite(description(notification.group).to_s)
|
20
20
|
end
|
21
21
|
|
22
22
|
def example_group_started(notification)
|
23
|
-
AllureRubyAdaptorApi::Builder.start_suite(notification.group.
|
23
|
+
AllureRubyAdaptorApi::Builder.start_suite(description(notification.group).to_s, labels(notification))
|
24
24
|
end
|
25
25
|
|
26
26
|
def example_passed(notification)
|
@@ -32,8 +32,8 @@ module AllureRSpec
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def example_started(notification)
|
35
|
-
suite = notification.example.example_group.
|
36
|
-
test = notification.example.
|
35
|
+
suite = description(notification.example.example_group).to_s
|
36
|
+
test = description(notification.example).to_s
|
37
37
|
AllureRubyAdaptorApi::Builder.start_test(suite, test, labels(notification))
|
38
38
|
end
|
39
39
|
|
@@ -52,11 +52,17 @@ module AllureRSpec
|
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
+
def description(data, attr = :full_description)
|
56
|
+
((data.respond_to?(attr)) ?
|
57
|
+
data.send(attr) : data.metadata[attr]) ||
|
58
|
+
description(data, :description)
|
59
|
+
end
|
60
|
+
|
55
61
|
def stop_test(example, opts = {})
|
56
62
|
res = example.execution_result
|
57
63
|
AllureRubyAdaptorApi::Builder.stop_test(
|
58
|
-
example.example_group.
|
59
|
-
example.
|
64
|
+
description(example.example_group).to_s,
|
65
|
+
description(example).to_s,
|
60
66
|
{
|
61
67
|
:status => res.status,
|
62
68
|
:finished_at => res.finished_at,
|
data/lib/allure-rspec/version.rb
CHANGED
data/spec/extend_steps_spec.rb
CHANGED
@@ -51,6 +51,14 @@ describe AllureRSpec, :feature => "Basics" do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
it "should be failed example" do
|
55
|
+
fail_spec "Failure"
|
56
|
+
end
|
57
|
+
|
58
|
+
def fail_spec(desc)
|
59
|
+
raise RSpec::Expectations::ExpectationNotMetError.new(desc)
|
60
|
+
end
|
61
|
+
|
54
62
|
it "should raise exception" do |e|
|
55
63
|
|
56
64
|
e.step "step1" do
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require "set"
|
3
|
+
|
4
|
+
shared_examples_for "a collection" do
|
5
|
+
let(:collection) { described_class.new([7, 2, 4]) }
|
6
|
+
|
7
|
+
context "initialized with 3 items" do
|
8
|
+
it "says it has three items" do
|
9
|
+
collection.size.should eq(3)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "#include?" do
|
14
|
+
context "with an an item that is in the collection" do
|
15
|
+
it "returns true" do
|
16
|
+
collection.include?(7).should be_true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "with an an item that is not in the collection" do
|
21
|
+
it "returns false" do
|
22
|
+
collection.include?(9).should be_false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe Array do
|
29
|
+
it_behaves_like "a collection"
|
30
|
+
end
|
31
|
+
|
32
|
+
describe Set do
|
33
|
+
it_behaves_like "a collection"
|
34
|
+
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.6
|
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-
|
11
|
+
date: 2014-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- logo.png
|
88
88
|
- spec/another_spec.rb
|
89
89
|
- spec/extend_steps_spec.rb
|
90
|
+
- spec/shared_example_spec.rb
|
90
91
|
- spec/spec_helper.rb
|
91
92
|
homepage: http://allure.qatools.ru
|
92
93
|
licenses:
|
@@ -111,6 +112,6 @@ rubyforge_project:
|
|
111
112
|
rubygems_version: 2.0.3
|
112
113
|
signing_key:
|
113
114
|
specification_version: 4
|
114
|
-
summary: allure-rspec-0.6.
|
115
|
+
summary: allure-rspec-0.6.6
|
115
116
|
test_files: []
|
116
117
|
has_rdoc:
|