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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c09d319b4f770d06ade3103b596607c4bfdfd03
4
- data.tar.gz: cafde30c320995275c09c5c7c2e442f3ec37dc05
3
+ metadata.gz: 4f5395116359bfd7bf306159077438a646322706
4
+ data.tar.gz: 77e31a2c0462029ab44e36692aa89dffa470d917
5
5
  SHA512:
6
- metadata.gz: a91f2cafc77fd94f3c8a70f624277eda2130b204081e4a5d6b60f85a27a1e66d851c714298f79dd0a169fa038f1f0a71ce76b15066ef6e060f56dedf291929d3
7
- data.tar.gz: 979bdd3c7e04bdb55a91ef477ad6d5e1e8a5712695e9feed0f886f455ad603e30b4a34c0b924c3003767304e53a573fd3f9cdf3472c179f7b66dd8a014e6607f
6
+ metadata.gz: 75486c8ecf8b9c0db5bdfa0d91bf1ee6dcefff77d9b756f1ee8f1f8670c3ec95f78e2fbaca461d65e54b0ae7bba320c386cde0a45db213500587b369e1b2ca07
7
+ data.tar.gz: 45fb36c869f2fc088203fc1c300cb2ca55c713c99f9d3ec1af9ccdcb252c341cc62f07f93e1814d37ddb049e24f86bb093943ffab85888aa4b9608f344ee83f8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- allure-rspec (0.6.3)
4
+ allure-rspec (0.6.4)
5
5
  allure-ruby-adaptor-api (= 0.6.3)
6
6
  rspec (= 3.0.0)
7
7
 
@@ -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(example)
13
- res = example.example.execution_result
14
- AllureRubyAdaptorApi::Builder.stop_test(
15
- example.example.example_group.description,
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(group)
27
- AllureRubyAdaptorApi::Builder.stop_suite(group.group.description.to_s)
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(group)
31
- AllureRubyAdaptorApi::Builder.start_suite(group.group.description.to_s, labels(group))
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(example)
35
- res = example.example.execution_result
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(example)
30
+ def example_pending(notification)
31
+ stop_test(notification.example)
48
32
  end
49
33
 
50
- def example_started(example)
51
- suite = example.example.example_group.description
52
- test = example.example.description.to_s
53
- AllureRubyAdaptorApi::Builder.start_test(suite, test, labels(example))
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 :
@@ -1,5 +1,5 @@
1
1
  module AllureRSpec # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.6.3'
3
+ STRING = '0.6.4'
4
4
  end
5
5
  end
@@ -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 |ex|
39
- ex.attach_file "test-file1", Tempfile.new("test")
40
- ex.step "step1" do |step|
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
- ex.step "step2" do |step|
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
- ex.step "step3" do
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.3
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-01 00:00:00.000000000 Z
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.3
114
+ summary: allure-rspec-0.6.4
115
115
  test_files: []
116
116
  has_rdoc: