pauldix-sax-machine 0.0.6 → 0.0.7

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.
@@ -17,6 +17,10 @@ module SAXMachine
17
17
  end
18
18
  end
19
19
 
20
+ def cdata_block(string)
21
+ characters(string)
22
+ end
23
+
20
24
  def start_element(name, attrs = [])
21
25
  @name = name
22
26
  @attrs = attrs
data/lib/sax-machine.rb CHANGED
@@ -7,5 +7,5 @@ require "sax-machine/sax_handler"
7
7
  require "sax-machine/sax_config"
8
8
 
9
9
  module SAXMachine
10
- VERSION = "0.0.6"
10
+ VERSION = "0.0.7"
11
11
  end
@@ -36,7 +36,7 @@ describe "SAXMachine" do
36
36
  document.title.should == "Title"
37
37
  end
38
38
 
39
- it "should overwrite the accessor when the element is present" do
39
+ it "should overwrite the value when the element is present" do
40
40
  document = @klass.new
41
41
  document.title = "Old title"
42
42
  document.parse("<title>New title</title>")
@@ -47,6 +47,11 @@ describe "SAXMachine" do
47
47
  document = @klass.parse("<title>My Title</title>")
48
48
  document.title.should == "My Title"
49
49
  end
50
+
51
+ it "should save cdata into an accessor" do
52
+ document = @klass.parse("<title><![CDATA[A Title]]></title>")
53
+ document.title.should == "A Title"
54
+ end
50
55
 
51
56
  it "should save the element text into an accessor when there are multiple elements" do
52
57
  document = @klass.parse("<xml><title>My Title</title><foo>bar</foo></xml>")
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,7 @@ begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
7
7
  path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
8
8
  $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
9
9
 
10
- require "sax-machine"
10
+ require "lib/sax-machine"
11
11
 
12
12
  # Spec::Runner.configure do |config|
13
13
  # end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pauldix-sax-machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Dix