Permalink
Browse files

Fix valid_html5 matchers

  • Loading branch information...
1 parent 8f2fd0d commit 71bb9ee928ca63e30fff423702ec2c058b12ef2f @xaviershay committed Nov 14, 2010
Showing with 10 additions and 9 deletions.
  1. +1 −1 Gemfile
  2. +2 −2 Gemfile.lock
  3. +7 −6 spec/support/be_valid_html5.rb
View
@@ -35,5 +35,5 @@ group :development, :test do
gem 'factory_girl'
gem 'rspec'
gem 'rspec-rails'
- gem 'xml-simple', :require => 'xmlsimple'
+ gem 'hpricot'
end
View
@@ -53,6 +53,7 @@ GEM
gherkin (2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
+ hpricot (0.8.3)
i18n (0.4.2)
json (1.4.6)
lesstile (1.0.0)
@@ -108,7 +109,6 @@ GEM
rack (>= 1.0)
rack-test (>= 0.5.3)
will_paginate (3.0.pre2)
- xml-simple (1.0.12)
PLATFORMS
ruby
@@ -120,6 +120,7 @@ DEPENDENCIES
cucumber-rails
factory_girl
formtastic
+ hpricot
lesstile
rack-openid
rails (= 3.0.1)
@@ -129,4 +130,3 @@ DEPENDENCIES
sqlite3-ruby
webrat
will_paginate (~> 3.0.pre3)
- xml-simple
@@ -5,7 +5,8 @@
class BeValidHtml5
- def initialize(options)
+ def initialize(base, options)
+ @base = base
@fragment = options[:fragment]
end
@@ -38,9 +39,9 @@ def initialize(options)
class_inheritable_accessor :auto_validate_includes
- def matches?(response)
- fn = response.rendered[:template].template_path
- fragment = response.body
+ def matches?(rendered)
+ fn = @base
+ fragment = rendered
fragment = wrap_with_html5_header(fragment) if @fragment
return true if validity_checks_disabled?
base_filename = cache_resource('markup',fragment,fn)
@@ -142,9 +143,9 @@ def http
end
def be_valid_html5
- BeValidhtml5.new
+ BeValidhtml5.new(subject)
end
def be_valid_html5_fragment
- BeValidHtml5.new(:fragment => true)
+ BeValidHtml5.new(subject, :fragment => true)
end

0 comments on commit 71bb9ee

Please sign in to comment.