cornucopia 0.1.30 → 0.1.31
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/cornucopia.gemspec +2 -0
- data/lib/cornucopia.rb +5 -1
- data/lib/cornucopia/capybara/page_diagnostics.rb +2 -2
- data/lib/cornucopia/rspec_hooks.rb +1 -1
- data/lib/cornucopia/util/file_asset.rb +1 -0
- data/lib/cornucopia/util/log_capture.rb +3 -3
- data/lib/cornucopia/util/report_builder.rb +15 -9
- data/lib/cornucopia/util/report_table.rb +1 -1
- data/lib/cornucopia/util/test_helper.rb +3 -1
- data/lib/cornucopia/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c88df284941af422e21533cd36f416f93330c53d
|
4
|
+
data.tar.gz: 87a0f2b7e8d0cd81f8d44597958595412c748c33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 813c6d01477e15fdda7e2cd1eeed250146fb72e0f5317860a27935179f42b03648e8db3a6937f05630711b9034c6fdde8c6104a142bebb6cef76fca564acf6a8
|
7
|
+
data.tar.gz: 06ef95cddad32a46f6c23e8251428fb01ed484202b236788bbca3e8bf1185ce72f531ff2823b4c56ba34749eae535dd520da942be5dee9c29e134fd3b9abe415
|
data/cornucopia.gemspec
CHANGED
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
+
spec.add_dependency "activesupport"
|
26
|
+
|
25
27
|
spec.add_development_dependency "rails"
|
26
28
|
spec.add_development_dependency "mysql2"
|
27
29
|
spec.add_development_dependency "bundler"
|
data/lib/cornucopia.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
require "cornucopia/version"
|
2
|
+
|
3
|
+
require "active_support"
|
4
|
+
require "active_support/core_ext"
|
5
|
+
|
2
6
|
require "cornucopia/util/configuration"
|
3
7
|
require "cornucopia/util/configured_report"
|
4
8
|
require "cornucopia/util/generic_settings"
|
5
9
|
require "cornucopia/util/file_asset"
|
6
10
|
require "cornucopia/util/log_capture"
|
7
11
|
require "cornucopia/util/pretty_formatter"
|
8
|
-
require "cornucopia/util/report_table"
|
9
12
|
require "cornucopia/util/report_builder"
|
13
|
+
require "cornucopia/util/report_table"
|
10
14
|
require "cornucopia/util/test_helper"
|
11
15
|
require "cornucopia/capybara/finder_diagnostics"
|
12
16
|
require "cornucopia/capybara/page_diagnostics"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "digest"
|
2
|
-
require ::File.expand_path("../util/configuration", File.dirname(__FILE__))
|
2
|
+
# require ::File.expand_path("../util/configuration", File.dirname(__FILE__))
|
3
3
|
require ::File.expand_path("../util/report_builder", File.dirname(__FILE__))
|
4
4
|
require ::File.expand_path("../util/report_table", File.dirname(__FILE__))
|
5
5
|
|
@@ -141,7 +141,7 @@ module Cornucopia
|
|
141
141
|
unless @unsupported_list.include?(function_symbol)
|
142
142
|
value = @driver.send(function_symbol, *args)
|
143
143
|
end
|
144
|
-
rescue ::Capybara::NotSupportedByDriverError
|
144
|
+
rescue ::Capybara::NotSupportedByDriverError
|
145
145
|
@unsupported_list << function_symbol
|
146
146
|
end
|
147
147
|
|
@@ -52,7 +52,7 @@ RSpec.configure do |config|
|
|
52
52
|
example.run
|
53
53
|
|
54
54
|
if (test_example.exception)
|
55
|
-
puts
|
55
|
+
puts("random seed for testing was: #{@context_seed_value}, #{@seed_value}")
|
56
56
|
|
57
57
|
Cornucopia::Util::ReportBuilder.current_report.
|
58
58
|
within_section("Test Error: #{test_example.full_description}") do |report|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require ::File.expand_path('configuration', File.dirname(__FILE__))
|
1
|
+
# require ::File.expand_path('configuration', File.dirname(__FILE__))
|
2
2
|
require ::File.expand_path('report_builder', File.dirname(__FILE__))
|
3
3
|
|
4
4
|
module Cornucopia
|
@@ -93,7 +93,7 @@ module Cornucopia
|
|
93
93
|
|
94
94
|
File.open(log_file_name) do |log_file|
|
95
95
|
seek_len = [file_size, TAIL_BUF_LENGTH].min
|
96
|
-
log_file.seek
|
96
|
+
log_file.seek(-seek_len, IO::SEEK_END)
|
97
97
|
|
98
98
|
while (log_buffer.count("\n") <= num_lines)
|
99
99
|
log_buffer = log_file.read(seek_len) + log_buffer
|
@@ -103,7 +103,7 @@ module Cornucopia
|
|
103
103
|
|
104
104
|
break if seek_len <= 0
|
105
105
|
|
106
|
-
log_file.seek
|
106
|
+
log_file.seek(-seek_len - TAIL_BUF_LENGTH, IO::SEEK_CUR)
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -2,7 +2,7 @@ require "timeout"
|
|
2
2
|
require ::File.expand_path('file_asset', File.dirname(__FILE__))
|
3
3
|
require ::File.expand_path('pretty_formatter', File.dirname(__FILE__))
|
4
4
|
require ::File.expand_path('report_table', File.dirname(__FILE__))
|
5
|
-
require ::File.expand_path('configuration', File.dirname(__FILE__))
|
5
|
+
# require ::File.expand_path('configuration', File.dirname(__FILE__))
|
6
6
|
|
7
7
|
module Cornucopia
|
8
8
|
module Util
|
@@ -89,7 +89,9 @@ module Cornucopia
|
|
89
89
|
if Object.const_defined?("Capybara")
|
90
90
|
timeout_length = [timeout_length, ::Capybara.default_wait_time].max
|
91
91
|
end
|
92
|
-
|
92
|
+
if Object.const_defined?("Rails")
|
93
|
+
timeout_length = [timeout_length, 60 * 60].max if Rails.env.development?
|
94
|
+
end
|
93
95
|
|
94
96
|
Timeout::timeout(timeout_length) do
|
95
97
|
if value.is_a?(String)
|
@@ -197,13 +199,17 @@ module Cornucopia
|
|
197
199
|
end
|
198
200
|
|
199
201
|
def initialize(folder_name = nil, parent_folder = nil)
|
200
|
-
@parent_folder_name
|
201
|
-
@base_folder_name
|
202
|
-
@report_title
|
203
|
-
@test_name
|
204
|
-
@section_number
|
205
|
-
@test_number
|
206
|
-
@report_body
|
202
|
+
@parent_folder_name = parent_folder || Cornucopia::Util::Configuration.base_folder
|
203
|
+
@base_folder_name = folder_name || Cornucopia::Util::Configuration.base_folder
|
204
|
+
@report_title = folder_name || Cornucopia::Util::Configuration.base_folder
|
205
|
+
@test_name = "unknown_test"
|
206
|
+
@section_number = 0
|
207
|
+
@test_number = 0
|
208
|
+
@report_body = "".html_safe
|
209
|
+
@report_folder_name = nil
|
210
|
+
@index_folder_name = nil
|
211
|
+
@report_test_folder_name = nil
|
212
|
+
@test_list_item = nil
|
207
213
|
end
|
208
214
|
|
209
215
|
# This does nothing in a normal report because reports are built as you go.
|
@@ -43,7 +43,9 @@ module Cornucopia
|
|
43
43
|
|
44
44
|
def record_test(start_end, test_name)
|
45
45
|
if Cornucopia::Util::Configuration.record_test_start_and_end_in_log
|
46
|
-
|
46
|
+
if Object.const_defined?("Rails")
|
47
|
+
Rails.logger.error(test_message(start_end, test_name))
|
48
|
+
end
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
data/lib/cornucopia/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cornucopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RealNobody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rails
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|