allure-rspec 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec3bdd1ae2140ef088da5974df84f40ef4650d65
4
- data.tar.gz: 2ddf04e97493c8a8942968c6f384db8e652132a6
3
+ metadata.gz: 7e65ce5bd4c4284c9468ffa80e38ba3d11fb78f6
4
+ data.tar.gz: a88e0b7709f0c4f81491d905cc828474dd4cea16
5
5
  SHA512:
6
- metadata.gz: 56a969b6d8b3f6bf888fcdbd11b7cf69d94e8e2ce3e7469f99fc7f1335a2e1ca7042f605dc3404619f55e14fa0c377b6ebeaeedd6e130ee55194f20f7d52bf1f
7
- data.tar.gz: b4c3a6a365192e129bf0057278e8c8abc4a9691ff657d22b12b07ae597fd493cf4b3020a018f7d5885a95b00a223f9c948ba0bbe190ef144ce5e4e712c1adb2d
6
+ metadata.gz: 1e40604de0297a49ca2cd648d4cd9cfa31a812a06ff11d870e46f4ba6c88b3af0ebcd620d9a980c73175907146f6ffb22df818a3249d76bc0b58a1fb148db070
7
+ data.tar.gz: ac482c8e6c63a682f986b7aaa048373954a2946ed694f1bbbd35a22feccb3b7f17e322f0098a0538941a074441b6c1d0dafb9dc8b09eb41bb3b50cf72e1aa2cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- allure-rspec (0.6.5)
4
+ allure-rspec (0.6.6)
5
5
  allure-ruby-adaptor-api (= 0.6.3)
6
6
  rspec (~> 3.0)
7
7
 
@@ -13,8 +13,8 @@ module AllureRSpec
13
13
  end
14
14
 
15
15
  def step(step, &block)
16
- suite = metadata[:example_group][:description_args].first.to_s
17
- test = metadata[:description].to_s
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][:description_args].first.to_s
30
- test = metadata[:description].to_s
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.description.to_s)
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.description.to_s, labels(notification))
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.description
36
- test = notification.example.description.to_s
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.description,
59
- example.description.to_s,
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,
@@ -1,5 +1,5 @@
1
1
  module AllureRSpec # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.6.5'
3
+ STRING = '0.6.6'
4
4
  end
5
5
  end
@@ -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.5
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-09-07 00:00:00.000000000 Z
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.5
115
+ summary: allure-rspec-0.6.6
115
116
  test_files: []
116
117
  has_rdoc: