Permalink
Browse files

Update readme.md

  • Loading branch information...
Dan Carper
Dan Carper committed Aug 21, 2012
1 parent b4cb5d5 commit 58e211604e8bb0b190d771b51d020806935b8683
Showing with 23 additions and 2 deletions.
  1. +23 −2 readme.md
View
@@ -2,11 +2,32 @@
*spec your xml*
## installation
-```ruby Gemfile
+```
+# Gemfile
gem 'rspec-xml'
```
## Usage
-```ruby some_spec.rb
+
+```ruby
+# some_spec.rb
+"<something>else</something>".should have_xpath('/something')
"<something>else</something>".should have_xpath('/something').with_text('else')
+
+"<something>else</something>".should_not have_xpath('/what')
+"<something>else</something>".should_not have_xpath('/something').with_text('what')
```
+
+### Builder
+
+```ruby
+xml = ''
+builder = Builder::XmlMarkup.new(:target => xml)
+builder.instruct!
+
+builder.some_xml do |xml|
+ xml.inner 'stuff'
+end
+
+xml.should have_xpath('//some_xml/inner').with_text('stuff')
+```

0 comments on commit 58e2116

Please sign in to comment.