allure-rspec 0.6.7 → 0.6.8

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: 54a18d79af9a7b047a8f9459ae73c53b576845e9
4
- data.tar.gz: 7492bba6a8c5cc1542684a22012edcea57b5fa5b
3
+ metadata.gz: 0f8f7bec6b49c04903d8562724627fd7fcdc02e2
4
+ data.tar.gz: e6206e6c334bacb9ca863cbfc893b52cd964edc0
5
5
  SHA512:
6
- metadata.gz: 45ecb6ed370b23f1b6309f3d181f8cbc3474ab79d2e163bc5d83851115208502ce59316b0fafa65b189c3e3ae1dd153163659a008c361b183a24ac9d4d363b41
7
- data.tar.gz: a7e9f3bdbdcdb0a76268ecf09250781868cf6d36d18d41a089f62fc0d22a03eef54b0217f707279669f29e589cf5de150c4543a85de91b1b8ac5af47e2c35523
6
+ metadata.gz: 5150e93eecca7f35af59d145f7710607a38069a26282b1e8e25e9d9ff6106c9feb6ecfaa0225915ffcfe8160feb9907bcd1ce3991933ddd869a3b767800c553e
7
+ data.tar.gz: 9a5c4867d4f6d8afb64974740e19be21f5e9183f8b227779bf411e3e3063a9c7bf5c4bfff001b57aeea5db2dcb514b3cdbb0ceadf283379ceb05bcd50b8e80e1
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- allure-rspec (0.6.7)
5
- allure-ruby-adaptor-api (= 0.6.4)
4
+ allure-rspec (0.6.8)
5
+ allure-ruby-adaptor-api (= 0.6.5)
6
6
  rspec (~> 3.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- allure-ruby-adaptor-api (0.6.4)
11
+ allure-ruby-adaptor-api (0.6.5)
12
12
  mimemagic
13
13
  nokogiri (~> 1.6.0)
14
14
  uuid
@@ -16,9 +16,9 @@ GEM
16
16
  macaddr (1.7.1)
17
17
  systemu (~> 2.6.2)
18
18
  mimemagic (0.2.1)
19
- mini_portile (0.6.0)
20
- nokogiri (1.6.3.1)
21
- mini_portile (= 0.6.0)
19
+ mini_portile (0.6.2)
20
+ nokogiri (1.6.5)
21
+ mini_portile (~> 0.6.0)
22
22
  rake (10.3.2)
23
23
  rspec (3.1.0)
24
24
  rspec-core (~> 3.1.0)
data/allure-rspec.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ['lib']
20
20
 
21
21
  s.add_dependency 'rspec', '~> 3.0'
22
- s.add_dependency 'allure-ruby-adaptor-api', '0.6.4'
22
+ s.add_dependency 'allure-ruby-adaptor-api', '0.6.5'
23
23
 
24
24
  s.add_development_dependency 'bundler'
25
25
  s.add_development_dependency 'rake'
@@ -72,16 +72,39 @@ module AllureRSpec
72
72
  end
73
73
 
74
74
  def metadata(example_or_group)
75
- (example_or_group.respond_to? :group) ?
75
+ group?(example_or_group) ?
76
76
  example_or_group.group.metadata :
77
77
  example_or_group.example.metadata
78
78
  end
79
79
 
80
+ def group?(example_or_group)
81
+ (example_or_group.respond_to? :group)
82
+ end
83
+
80
84
  def labels(example_or_group)
81
- ALLOWED_LABELS.
82
- map { |label| [label, metadata(example_or_group)[label]] }.
85
+ labels = ALLOWED_LABELS.map { |label| [label, metadata(example_or_group)[label]] }.
83
86
  find_all { |value| !value[1].nil? }.
84
87
  inject({}) { |res, value| res.merge(value[0] => value[1]) }
88
+ detect_feature_story(labels, example_or_group)
89
+ labels
90
+ end
91
+
92
+ def detect_feature_story(labels, example_or_group)
93
+ metadata = metadata(example_or_group)
94
+ is_group = group?(example_or_group)
95
+ parent = metadata[:parent_example_group] || metadata[:example_group]
96
+ if labels[:feature] === true
97
+ description = (!is_group && parent) ? parent[:description] : metadata[:description]
98
+ labels[:feature] = description
99
+ if labels[:story] === true
100
+ if parent
101
+ grandparent = parent && parent[:parent_example_group]
102
+ labels[:feature] = (!is_group && grandparent) ? grandparent[:description] : parent[:description]
103
+ end
104
+ labels[:story] = description
105
+ end
106
+ end
107
+ labels
85
108
  end
86
109
 
87
110
  end
@@ -1,5 +1,5 @@
1
1
  module AllureRSpec # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.6.7'
3
+ STRING = '0.6.8'
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+ require 'tempfile'
3
+
4
+ describe "Some feature", :feature do
5
+ describe "Some story", :story do
6
+ it "20 should be greater than 19", :story do
7
+ expect(20).to be > 19
8
+ end
9
+ end
10
+
11
+ 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.7
4
+ version: 0.6.8
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-10-30 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.4
33
+ version: 0.6.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.6.4
40
+ version: 0.6.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,7 @@ files:
87
87
  - logo.png
88
88
  - spec/another_spec.rb
89
89
  - spec/extend_steps_spec.rb
90
+ - spec/nometavalue_spec.rb
90
91
  - spec/shared_example_spec.rb
91
92
  - spec/spec_helper.rb
92
93
  homepage: http://allure.qatools.ru
@@ -112,6 +113,6 @@ rubyforge_project:
112
113
  rubygems_version: 2.0.3
113
114
  signing_key:
114
115
  specification_version: 4
115
- summary: allure-rspec-0.6.7
116
+ summary: allure-rspec-0.6.8
116
117
  test_files: []
117
118
  has_rdoc: