nokogiri-styles 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ require 'nokogiri-styles/propset'
3
3
  module NokogiriStyles
4
4
  module NodeStyles
5
5
  def styles
6
- return NokogiriStyles::Propset.new(self['style'])
6
+ return NokogiriStyles::Propset.new(self['style'] || '')
7
7
  end
8
8
 
9
9
  def styles=(value)
@@ -1,3 +1,3 @@
1
1
  module NokogiriStyles
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -28,6 +28,13 @@ class TestNodeStyles < Test::Unit::TestCase
28
28
  assert_equal(node.styles.class, NokogiriStyles::Propset)
29
29
  end
30
30
 
31
+ def test_nil_style
32
+ node = MockNode.new
33
+ assert_nothing_raised do
34
+ assert_equal('', node.styles.to_s)
35
+ end
36
+ end
37
+
31
38
  def test_set_styles
32
39
  node = MockNode.new
33
40
  node.styles = MockStyles.new('width: 2px; height: 4px')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri-styles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: