cornucopia 0.1.15 → 0.1.16

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: 3bbf7f8abccf3fce5d307ac06dd1215471b3b3a0
4
- data.tar.gz: 32a60a2590a58d37617092b6fef5961f1cf05e14
3
+ metadata.gz: bd93163007cffbc1d139c208d1fafd4b3c6a776f
4
+ data.tar.gz: 3be2a99870eea81dc4e7634f6b2e4c3af895f478
5
5
  SHA512:
6
- metadata.gz: 16810c0c3b197e50db0bb2331492786af365d607fadd96d6f2ad91687304128b8577d938cfdb2857ac5c63c3ba074c4e5f8fd0eb6bb1175a9d0dd71a5c1a5c8f
7
- data.tar.gz: db32c9f9023bec3fdf6cd404c0d43d0c7fa8e0ab6893dc5f2a49e7ef50ed0b98a7005b4bf34b9bf9c50295fc7b845f10e0913e38b115206b9ca1c3aaf7dc54ac
6
+ metadata.gz: dd9fc46194b3b61840474ec462444434786222d987400b5ec1f3018aa3cbf26637c4a1ecabac5393843b322df0d338c8caf170ecae002b548f1ca8b06a64886b
7
+ data.tar.gz: 2ad558e17c4bf9f80ab3bb08a9e88bafe19a57805cdbe025b8dc4bfb50004c28e640eee1abbc43faa641a95771c0c7a252209afc7031a3044cf01f42821753da
data/README.md CHANGED
@@ -366,6 +366,6 @@ SitePrism override section, element, sections and elements command to allow para
366
366
  main function (name)
367
367
  has_
368
368
  ???
369
+ Already done only if original definition doesn't have options
369
370
  Make configuration a singleton
370
- SitePrism work with Capybara::Node::Simple
371
371
  ReportBuilder - reformat and styling of report?
@@ -266,6 +266,14 @@ module Cornucopia
266
266
  # end
267
267
  # end
268
268
  end
269
+
270
+ def owner_node
271
+ @__corunucopia_base_node
272
+ end
273
+
274
+ def owner_node=(base_node)
275
+ @__corunucopia_base_node = base_node
276
+ end
269
277
  end
270
278
  end
271
279
  end
@@ -6,6 +6,18 @@ if Object.const_defined?("SitePrism") &&
6
6
  module ::SitePrism
7
7
  class Page
8
8
  include Cornucopia::SitePrism::ElementExtensions
9
+
10
+ ::Capybara::Session::DSL_METHODS.each do |method|
11
+ alias_method "__cornucopia_orig_#{method}".to_sym, method
12
+
13
+ define_method method do |*args, &block|
14
+ if @__corunucopia_base_node
15
+ @__corunucopia_base_node.send method, *args, &block
16
+ else
17
+ send "__cornucopia_orig_#{method}", *args, &block
18
+ end
19
+ end
20
+ end
9
21
  end
10
22
  end
11
23
  end
@@ -18,6 +30,25 @@ if Object.const_defined?("SitePrism") &&
18
30
  module ::SitePrism
19
31
  class Section
20
32
  include Cornucopia::SitePrism::ElementExtensions
33
+
34
+ alias_method :__corunucopia_orig_intialize, :initialize
35
+ def initialize(*args)
36
+ __corunucopia_orig_intialize(*args)
37
+
38
+ self.owner_node = args[0].owner_node
39
+ end
40
+
41
+ ::Capybara::Session::DSL_METHODS.each do |method|
42
+ alias_method "__cornucopia_orig_#{method}".to_sym, method
43
+
44
+ define_method method do |*args, &block|
45
+ if @__corunucopia_base_node
46
+ @__corunucopia_base_node.send method, *args, &block
47
+ else
48
+ send "__cornucopia_orig_#{method}", *args, &block
49
+ end
50
+ end
51
+ end
21
52
  end
22
53
  end
23
54
  end
@@ -60,8 +60,10 @@
60
60
 
61
61
  .cornucopia-cell-label
62
62
  {
63
- padding-right: 5px;
64
- padding-left: 5px;
63
+ padding-top: 1px;
64
+ padding-bottom: 1px;
65
+ padding-right: 5px;
66
+ padding-left: 5px;
65
67
  }
66
68
 
67
69
  .cornucopia-cell-expand,
@@ -141,7 +143,9 @@
141
143
 
142
144
  .hide-contents pre
143
145
  {
144
- margin-top: 0px
146
+ padding-top: 3px;
147
+ padding-bottom: 3px;
148
+ margin-top: 0px
145
149
  }
146
150
 
147
151
  .completed-other
@@ -230,4 +234,9 @@
230
234
  width: 100%;
231
235
  height: 100%;
232
236
  border-style: none;
237
+ }
238
+
239
+ .cornucopia-cell-more-data img
240
+ {
241
+ margin-top: 3px;
233
242
  }
@@ -1,3 +1,3 @@
1
1
  module Cornucopia
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
@@ -239,6 +239,8 @@ describe Cornucopia::Capybara::FinderDiagnostics, type: :feature do
239
239
  report_page.displayed_test do |test_page|
240
240
  test_page.contents do |contents_frame|
241
241
  expect(contents_frame.errors.length).to be == 1
242
+ # this line is the same as the next one. I added this line to test a line in the site-prims extentions.
243
+ expect(contents_frame.errors[0].find("p").text).to be == "Diagnostic report on \"all\":"
242
244
  expect(contents_frame.errors[0].name.text).to be == "Diagnostic report on \"all\":"
243
245
  expect(contents_frame.errors[0].tables[0].rows.length).to be == 7
244
246
  expect(contents_frame.errors[0].tables[0].rows[0].labels[0].text).to be == "function_name"
@@ -2,6 +2,16 @@ require "rails_helper"
2
2
  require ::File.expand_path("../../../lib/cornucopia/util/report_builder", File.dirname(__FILE__))
3
3
 
4
4
  describe Cornucopia::Util::ReportBuilder do
5
+ let(:test_names) do
6
+ rand(3..5).times.map do
7
+ Faker::Lorem.sentence
8
+ end
9
+ end
10
+ let(:section_names) do
11
+ test_names.length.times.map do
12
+ Faker::Lorem.sentence
13
+ end
14
+ end
5
15
  let(:current_report) { Cornucopia::Util::ReportBuilder.new_report }
6
16
  let(:custom_report) { Cornucopia::Util::ReportBuilder.new_report("cool_report", "diag_reports") }
7
17
 
@@ -932,17 +942,6 @@ describe Cornucopia::Util::ReportBuilder do
932
942
  end
933
943
 
934
944
  describe "#within_test" do
935
- let(:test_names) do
936
- rand(3..5).times.map do
937
- Faker::Lorem.sentence
938
- end
939
- end
940
- let(:section_names) do
941
- test_names.length.times.map do
942
- Faker::Lorem.sentence
943
- end
944
- end
945
-
946
945
  it "starts a test with a specific name" do
947
946
  current_report = send(report_settings[:report])
948
947
 
@@ -1328,4 +1327,30 @@ describe Cornucopia::Util::ReportBuilder do
1328
1327
  end
1329
1328
  end
1330
1329
  end
1330
+
1331
+ it "outputs multiple tests" do
1332
+ test_names.each_with_index do |test_name, test_index|
1333
+ current_report.within_test(test_name) do
1334
+ current_report.within_section(section_names[test_index]) do |report_section|
1335
+ report_section.within_table do |report_table|
1336
+ report_table.write_stats(Faker::Lorem.word, Faker::Lorem.sentence)
1337
+ end
1338
+ end
1339
+ end
1340
+ end
1341
+
1342
+ current_report.close
1343
+ current_report.instance_variable_set(:@test_number, 0)
1344
+
1345
+ report_page = Capybara::Node::Simple.new(File.read(current_report.report_test_contents_page_name))
1346
+ report_table = CornucopiaReportApp.cornucopia_report_test_contents_page
1347
+
1348
+ report_table.owner_node = report_page
1349
+
1350
+ expect(report_table.errors.count).to eq 1
1351
+ section = report_table.errors[0]
1352
+ # this line is the same as the next one. I added this line to test a line in the site-prims extentions.
1353
+ expect(section.find("p").text).to eq section_names[0]
1354
+ expect(section.name.text).to eq section_names[0]
1355
+ end
1331
1356
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cornucopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - RealNobody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails