tddium_reporting 0.0.6 → 0.1.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
1
+ # Copyright (c) 2011 Solano Labs Inc. All Rights Reserved
2
+ #
3
+
4
+
5
+ module TddiumReporting
6
+ module RSpec
7
+ class CapybaraCaptureFormatter
8
+ include Capybara::DSL rescue nil
9
+ def capture_page
10
+ begin
11
+ if defined?(save_page)
12
+ save_page
13
+ elsif defined?(save_and_open_page)
14
+ save_and_open_page
15
+ end
16
+ rescue => e
17
+ puts "Error capturing Capybara page: #{e.inspect} #{e.backtrace}"
18
+ end
19
+ end
20
+
21
+ alias :example_passed :capture_page
22
+ alias :example_failed :capture_page
23
+
24
+ end
25
+
26
+ def rspec_capybara_capture(config)
27
+ begin
28
+ Capybara.save_and_open_page_path = test_exec_path
29
+ config.add_formatter(CapybaraCaptureFormatter)
30
+ rescue
31
+ end
32
+ end
33
+ end
34
+ end
@@ -79,4 +79,18 @@ module TddiumReporting
79
79
 
80
80
  end
81
81
 
82
+ def rspec_selenium_rc_capture(config)
83
+ config.after(:each) do
84
+ # Configure selenium-rc system capture
85
+ if defined?(selenium_driver)
86
+ begin
87
+ reporting = TddiumReporting::SystemCapture.new(selenium_driver, self)
88
+ reporting.capture_system_state
89
+ STDOUT.puts "%%TDDIUM_EXAMPLE_ID:#{reporting.example_id}%%"
90
+ rescue Exception => e
91
+ STDERR.puts "Problem while capturing system state" + e
92
+ end
93
+ end
94
+ end
95
+ end
82
96
  end
@@ -1,4 +1,4 @@
1
1
  # Copyright (c) 2011 Solano Labs All Rights Reserved
2
2
  module TddiumReporting
3
- VERSION = '0.0.6'
3
+ VERSION = '0.1.0.pre2'
4
4
  end
@@ -2,22 +2,15 @@
2
2
  require File.expand_path(File.dirname(__FILE__) + "/tddium_reporting/system_capture")
3
3
  require File.expand_path(File.dirname(__FILE__) + "/tddium_reporting/spec_runner")
4
4
  require File.expand_path(File.dirname(__FILE__) + "/tddium_reporting/exec_path")
5
+ require File.expand_path(File.dirname(__FILE__) + "/tddium_reporting/rspec")
5
6
 
6
- # Configure RSpec selenium 1 capture
7
7
  spec_runner = TddiumReporting::SpecRunner.runner
8
8
  if spec_runner && ENV["TDDIUM"] && spec_runner.respond_to?(:configure)
9
9
  spec_runner.configure do |config|
10
- config.after(:each) do
11
- if defined?(selenium_driver)
12
- begin
13
- reporting = TddiumReporting::SystemCapture.new(selenium_driver, self)
14
- reporting.capture_system_state
15
- STDOUT.puts "%%TDDIUM_EXAMPLE_ID:#{reporting.example_id}%%"
16
- rescue Exception => e
17
- STDERR.puts "Problem while capturing system state" + e
18
- end
19
- end
20
- end
10
+ include TddiumReporting
11
+ include TddiumReporting::RSpec
12
+ rspec_capybara_capture(config)
13
+ rspec_selenium_rc_capture(config)
21
14
  end
22
15
  end
23
16
 
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tddium_reporting
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.6
4
+ prerelease: 6
5
+ version: 0.1.0.pre2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Solano Labs
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-01 00:00:00 Z
13
+ date: 2011-10-27 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -48,6 +48,7 @@ files:
48
48
  - lib/tddium_reporting/cucumber.rb
49
49
  - lib/tddium_reporting/exec_path.rb
50
50
  - lib/tddium_reporting/respond_to_chain.rb
51
+ - lib/tddium_reporting/rspec.rb
51
52
  - lib/tddium_reporting/spec_runner.rb
52
53
  - lib/tddium_reporting/system_capture.rb
53
54
  - lib/tddium_reporting/version.rb
@@ -68,9 +69,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
69
  required_rubygems_version: !ruby/object:Gem::Requirement
69
70
  none: false
70
71
  requirements:
71
- - - ">="
72
+ - - ">"
72
73
  - !ruby/object:Gem::Version
73
- version: "0"
74
+ version: 1.3.1
74
75
  requirements: []
75
76
 
76
77
  rubyforge_project: tddium