Skip to content

Commit

Permalink
Minor copy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krasnoukhov committed Dec 16, 2014
1 parent a29294c commit 394b885
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ end

class Atom
include SAXMachine
# Using block handle custom parsing behavior
# Use block to modify the returned value
element :title do |title|
title.strip
end
Expand Down
8 changes: 4 additions & 4 deletions spec/sax-machine/sax_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def title=(val)
@klass = Class.new do
include SAXMachine

element :title do |title|
element :title do |title|
"#{title}!!!"
end

Expand All @@ -238,17 +238,17 @@ def title=(val)
end
end

it "handle element" do
it "uses block for element" do
document = @klass.parse("<title>SAX</title>")
expect(document.title).to eq("SAX!!!")
end

it 'handle attribute' do
it 'uses block for attribute' do
document = @klass.parse("<title id='345'>SAX</title>")
expect(document.id).to eq(345)
end

it "handle attribute value" do
it "uses block for attribute value" do
document = @klass.parse("<link foo='tEst'>hello</link>")
expect(document.link).to eq("test")
end
Expand Down

0 comments on commit 394b885

Please sign in to comment.