pauldix-sax-machine 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sax-machine/sax_handler.rb +4 -0
- data/lib/sax-machine.rb +1 -1
- data/spec/sax-machine/sax_document_spec.rb +6 -1
- data/spec/spec_helper.rb +1 -1
- metadata +1 -1
data/lib/sax-machine.rb
CHANGED
@@ -36,7 +36,7 @@ describe "SAXMachine" do
|
|
36
36
|
document.title.should == "Title"
|
37
37
|
end
|
38
38
|
|
39
|
-
it "should overwrite the
|
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
|