htmlgrid 1.1.2 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -123,9 +123,9 @@ class TestGrid < Minitest::Test
123
123
  def test_add_multiple__3
124
124
  @grid.add(["test", nil, "foo"], 0, 0)
125
125
  assert_equal(1, @grid.height)
126
- expected = '<TABLE cellspacing="0"><TR><TD>test</TD><TD>foo</TD></TR></TABLE>'
126
+ expected = '<TABLE cellspacing="0"><TR><TD>testfoo</TD></TR></TABLE>'
127
127
  assert_equal(expected, @grid.to_html(CGI.new))
128
- assert_equal(2, @grid.width)
128
+ assert_equal(1, @grid.width)
129
129
  end
130
130
  def test_add_fieldx
131
131
  @grid.add("test", 1, 0)
@@ -225,7 +225,7 @@ class TestGrid < Minitest::Test
225
225
  expected = '<TABLE cellspacing="0"><TR><TD class="foo">&nbsp;</TD></TR></TABLE>'
226
226
  assert_equal(expected, @grid.to_html(CGI.new))
227
227
  @grid.add(nil, 1,1)
228
- @grid.add_style('bar', 0, 1, 2)
228
+ @grid.add_style('bar', 0, 1, 2)
229
229
  expected = '<TABLE cellspacing="0"><TR><TD class="foo">&nbsp;</TD>'
230
230
  expected << '<TD>&nbsp;</TD></TR><TR><TD class="bar">&nbsp;</TD>'
231
231
  expected << '<TD class="bar">&nbsp;</TD></TR></TABLE>'
@@ -271,7 +271,7 @@ class TestGrid < Minitest::Test
271
271
  assert_equal(expected, @grid.to_html(CGI.new))
272
272
  end
273
273
  def test_attributes
274
- ### this test has changed behavior: its not desirable to have magically
274
+ ### this test has changed behavior: its not desirable to have magically
275
275
  ### transferred css information from a component to its container
276
276
  @grid.add(StubGridComponent.new, 0,0)
277
277
  expected = '<TABLE cellspacing="0"><TR><TD>bar</TD></TR></TABLE>'
@@ -309,7 +309,7 @@ class TestGrid < Minitest::Test
309
309
  end
310
310
  def test_set_row_attributes3
311
311
  @grid.set_row_attributes({'foo' => 'bar'}, 1, 2)
312
- expected = '<TABLE cellspacing="0"><TR><TD>&nbsp;</TD></TR><TR foo="bar"><TD>&nbsp;</TD></TR><TR foo="bar"><TD>&nbsp;</TD></TR></TABLE>'
312
+ expected = '<TABLE cellspacing="0"><TR><TD>&nbsp;</TD><TD>&nbsp;</TD></TR><TR foo="bar"><TD>&nbsp;</TD><TD>&nbsp;</TD></TR></TABLE>'
313
313
  assert_equal(expected, @grid.to_html(CGI.new))
314
314
  end
315
315
  def test_insert_row
@@ -357,7 +357,7 @@ class TestGrid < Minitest::Test
357
357
  end
358
358
  def test_nil_attribute2
359
359
  thing = StubGridComponent.new
360
- thing.set_attribute("class", nil)
360
+ thing.set_attribute("class", nil)
361
361
  @grid.add(thing, 0,0)
362
362
  @grid.to_html(CGI.new)
363
363
  end
@@ -367,15 +367,15 @@ class TestGrid < Minitest::Test
367
367
  @grid.to_html(CGI.new)
368
368
  end
369
369
  def test_add_negative
370
- assert_raises(ArgumentError) { @grid.add('foo', -1, 0) }
371
- assert_raises(ArgumentError) { @grid.add('foo', 0, -1) }
372
- assert_raises(ArgumentError) { @grid.add(['foo', 'bar'], -1, 0) }
373
- assert_raises(ArgumentError) { @grid.add(['foo', 'bar'], 0, -1) }
370
+ assert( @grid.add('foo', -1, 0) )
371
+ assert( @grid.add('foo', 0, -1) )
372
+ assert( @grid.add(['foo', 'bar'], -1, 0) )
373
+ assert( @grid.add(['foo', 'bar'], 0, -1) )
374
374
  end
375
375
  def test_add_style_negative
376
- assert_raises(ArgumentError) { @grid.add_style('bar', -1, 1) }
377
- assert_raises(ArgumentError) { @grid.add_style('bar', 1, -1) }
378
- assert_raises(ArgumentError) { @grid.add_style('bar', 1, 1, -1) }
379
- assert_raises(ArgumentError) { @grid.add_style('bar', 1, 1, 1,-1) }
376
+ assert( @grid.add_style('bar', -1, 1) )
377
+ assert( @grid.add_style('bar', 1, -1) )
378
+ assert( @grid.add_style('bar', 1, 1, -1) )
379
+ assert( @grid.add_style('bar', 1, 1, 1,-1) )
380
380
  end
381
381
  end
@@ -88,6 +88,9 @@ module InteractionTest
88
88
  end
89
89
  def error(key)
90
90
  end
91
+ def user_agent
92
+ 'user_agent'
93
+ end
91
94
  end
92
95
  class StubCompositeForm < HtmlGrid::Form
93
96
  COMPONENTS = {
@@ -247,9 +250,7 @@ module InteractionTest
247
250
  table = StubComposite4.new(
248
251
  StubCompositeModel.new, StubCompositeSession.new)
249
252
  assert_equal(<<-EXP.gsub(/\n|^\s*/, ''), table.to_html(CGI.new))
250
- <TABLE cellspacing="0">
251
- <TR><TD><A class="standard">brafoo</A></TD></TR>
252
- </TABLE>
253
+ <TABLE cellspacing=\"0\"><TR><TD class=\"dradnats\"><A class=\"standard\">brafoo</A></TD></TR></TABLE>
253
254
  EXP
254
255
  end
255
256
 
@@ -272,8 +273,8 @@ module InteractionTest
272
273
  '<TR><TD>interaction for Marcoumar</TD></TR>',
273
274
  '<TR><TD>interaction for Marcoumar</TD></TR></TABLE> <DIV id="drugs"></DIV><TABLE cellspacing="0">',
274
275
  '<TR><TH>&nbsp;</TH></TR>',
275
- '<TR><TD class="css.info"></TD></TR>',
276
- '<TR><TD class="css.info-bg"></TD></TR></TABLE>',
276
+ '<TR><TD class="css.info">&nbsp;</TD></TR>',
277
+ '<TR><TD class="css.info-bg">&nbsp;</TD></TR></TABLE>',
277
278
  ]
278
279
  html = composite.to_html(CGI.new)
279
280
  expected.each_with_index do |line, idx|
@@ -282,3 +283,4 @@ module InteractionTest
282
283
  end
283
284
  end
284
285
  end
286
+
@@ -28,6 +28,7 @@ $LOAD_PATH << File.dirname(__FILE__)
28
28
 
29
29
  require 'minitest'
30
30
  require 'minitest/autorun'
31
+ require 'flexmock/minitest'
31
32
  require 'stub/cgi'
32
33
  require 'sbsm/lookandfeel'
33
34
  require 'htmlgrid/template'
@@ -44,6 +45,9 @@ class StubTemplateSession
44
45
  end
45
46
  def server_name
46
47
  "testserver.com"
48
+ end
49
+ def server_port
50
+ '80'
47
51
  end
48
52
  alias :default_language :language
49
53
  end
@@ -60,6 +64,7 @@ class StubTemplateLookandfeel < SBSM::Lookandfeel
60
64
  self
61
65
  end
62
66
  end
67
+
63
68
  class Template < HtmlGrid::Template
64
69
  META_TAGS = [
65
70
  {
@@ -86,11 +91,29 @@ class TestTemplate < Minitest::Test
86
91
  result << @template.to_html(CGI.new)
87
92
  expected = [
88
93
  '<TITLE>Test</TITLE>',
89
- "<LINK rel=\"stylesheet\" type=\"text/css\" href=\"http://testserver.com/resources/gcc/test.css\">",
94
+ '<LINK rel="stylesheet" type="text/css" async="true" href="http://testserver.com:80/resources/gcc/test.css">',
90
95
  '<META http-equiv="robots" content="follow, index">',
91
96
  ]
92
97
  expected.each_with_index { |line, idx|
93
98
  assert(result.index(line), "#{idx} Missing: #{line} in #{result}")
94
99
  }
95
100
  end
101
+ def test_to_html_with_inline_css
102
+ @lookandfeel = flexmock('lnf', StubTemplateLookandfeel.new(StubTemplateSession.new))
103
+ @lookandfeel.should_receive(:resource).with(:css).and_return('test/inline.css')
104
+ @lookandfeel.should_receive(:lookup).with(:html_title).and_return('html_title').by_default
105
+ @lookandfeel.should_receive(:lookup).with(any).and_return(nil).by_default
106
+ @template = Template.new(nil, @lookandfeel, nil)
107
+ result = ""
108
+ result << @template.to_html(CGI.new)
109
+ expected = [
110
+ '<TITLE>html_title</TITLE>',
111
+ 'this is a dummy CSS file, which should be inlined',
112
+ '<STYLE rel="stylesheet" type="text/css" async="true">',
113
+ '<META http-equiv="robots" content="follow, index">',
114
+ ]
115
+ expected.each_with_index { |line, idx|
116
+ assert(result.index(line), "#{idx} Missing: #{line} in #{result}")
117
+ }
118
+ end
96
119
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sbsm
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.6.4
34
34
  type: :development
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'
40
+ version: 1.6.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -156,8 +156,9 @@ executables: []
156
156
  extensions: []
157
157
  extra_rdoc_files: []
158
158
  files:
159
- - History.txt
160
159
  - Manifest.txt
160
+ - TooltipDialog.txt
161
+ - interaction_no_inline.txt
161
162
  - lib/htmlgrid/booleanvalue.rb
162
163
  - lib/htmlgrid/button.rb
163
164
  - lib/htmlgrid/centeredcomposite.rb
@@ -214,6 +215,7 @@ files:
214
215
  - test/test_component.rb
215
216
  - test/test_composite.rb
216
217
  - test/test_datevalue.rb
218
+ - test/test_dojotoolkit.rb
217
219
  - test/test_form.rb
218
220
  - test/test_formlist.rb
219
221
  - test/test_grid.rb
@@ -244,10 +246,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
246
  - !ruby/object:Gem::Version
245
247
  version: '0'
246
248
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.5.1
249
+ rubygems_version: 3.1.2
249
250
  signing_key:
250
251
  specification_version: 4
251
252
  summary: HtmlGrid is a Html-ToolKit for Ruby Webframeworks.
252
253
  test_files: []
253
- has_rdoc:
@@ -1,68 +0,0 @@
1
- === 1.1.2 / 10.08.2016
2
-
3
- * Fix warnings by syntax or coding style
4
- * Fix test errors
5
- * Fix asset (doc) files permission
6
- * Fix installation issues on ruby 2.0.0 and 2.1.9
7
- * Add ruby 2.3.1 as ci target
8
-
9
- === 1.1.1 / 07.07.2016
10
-
11
- * Improve dojotoolkit.rb
12
-
13
- === 1.1.0 / 06.07.2016
14
-
15
- * Rename djConfig to dojoConfig
16
- * Rename dojoType to data-dojo-type
17
- * Remove duplicated dojoConfig (use only data-dojo-config)
18
- * Add package support for onload script
19
-
20
- === 1.0.9 / 05.07.2016
21
-
22
- * Made tooltip work with dojo 1.11
23
- * Only tested with dojo 1.11. Works probably with dojo >= 1.8.
24
-
25
- === 1.0.8 / 10.05.2015
26
-
27
- * Removed C-interface
28
- * Removed obsolete tests for RUBY_VERSION < 1.9
29
- * Ported to Ruby 2.3.0. Updated minitest. Use newer version of sbsm.
30
- * Ruby 1.9.3 is no longer supported
31
-
32
- === 1.0.7 / 03.12.2013
33
-
34
- * Remove LEGACY_INTERFACE. No. LEGACY_INTERFACE was readded before release 1.0.7
35
- * Make travis work just fine.
36
-
37
- === 1.0.6 / 06.04.2012
38
-
39
- * Updated onload problem against dojo 1.7
40
- * Removed old version support
41
-
42
- === 1.0.5 / 23.02.2012
43
-
44
- * trying to get rid of htmlgrid.so
45
-
46
- === 1.0.4 / 23.12.2011
47
-
48
- * Added force_encoding('utf-8') to the return value of Grid#to_html method
49
-
50
- === 1.0.3 / 23.12.2011
51
-
52
- * patch grid.c for Ruby 1.9.3
53
-
54
- === 1.0.2 / 23.12.2011
55
-
56
- * Fix FachinfoDocument encoding error
57
-
58
- === 1.0.1 / 09.12.2011
59
-
60
- * Updated component.rb to be compatible for both Ruby 1.8 and 1.9
61
- * Fixed require grid.o for gem install case
62
-
63
- === 1.0.0 / 16.12.2010
64
-
65
- * htmlgrid is now Ruby 1.9 ready.
66
-
67
- * Birthday!
68
-