Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Carper committed Aug 21, 2012
1 parent b4cb5d5 commit 58e2116
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions readme.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@
*spec your xml* *spec your xml*


## installation ## installation
```ruby Gemfile ```
# Gemfile
gem 'rspec-xml' gem 'rspec-xml'
``` ```


## Usage ## 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 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.