-
Notifications
You must be signed in to change notification settings - Fork 0
License
mightyverse/cucumber_xml
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Dependencies
--------------
Rails (you could run these steps with older versions of Rails, but this app was generated with 2.3.2)
sudo gem install rspec rspec-rails cucumber webrat
Steps for creating this project
-------------------------------
rails cucumber_xml
./script/generate scaffold project name:string notes:text complete:boolean
ruby script/generate cucumber
write a feature description and run it:
features/project_create_xml.feature
rake features
write a feature description that references an XML fixture, and DB fixture data to match:
features/project_xml.feature
features/xml/projects.xml
test/fixtures/projects.yml
note that cucumber has its own RAILS_ENV
to see what cucumber sees:
rake db:fixtures:load RAILS_ENV=cucumber
./script/server -e cucumber
configure xmlsubsetmatcher
add the following line to the botton of /features/support/env.rb
World(CustomMatchers)
add the following to your environment.rb (not sure why latest nokogiri goesn't work for me):
config.gem "nokogiri", :version => '=1.2.3'
in this case, the feature scenario describes xml which is a superset
of the default to_s, so it fails. (there is a node under the projects root
<total> which declares how many projects there are in the list.
To make it pass, add an xml builder file:
views/projects/index.xml.builder
add doc index
feature/support/doc_xml.rb
cd feature/support
ruby doc_xml.rb
open ../doc/index.html
---------
TODO
---------
* make doc output nicer with some css
* improve error reporting when XML documents don't match
* make xmlsubsetmatcher a gem: I started this but must be missing something basic
http://github.com/mightyverse/xml_subset_matcher/tree/master
master $ gem build xmlsubsetmatcher.gemspec
WARNING: no rubyforge_project specified
WARNING: description and summary are identical
Successfully built RubyGem
Name: xmlsubsetmatcher
Version: 0.0.3
File: xmlsubsetmatcher-0.0.3.gem
master $ irb
>> require 'rubygems'
=> false
>> require 'xmlsubsetmatcher'
LoadError: no such file to load -- xmlsubsetmatcher
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from (irb):2
>>
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published