Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

should include a valid css helper for pygments

  • Loading branch information...
commit 2fb1c5821cc7432d193edf529642ae4b9bf2b3b8 1 parent 4209728
@zzak authored
Showing with 20 additions and 0 deletions.
  1. +1 −0  glorify.gemspec
  2. +9 −0 spec/glorify_spec.rb
  3. +10 −0 spec/spec_helper.rb
View
1  glorify.gemspec
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "minitest"
s.add_development_dependency "rack-test"
s.add_development_dependency "rake"
+ s.add_development_dependency "w3c_validators"
end
View
9 spec/glorify_spec.rb
@@ -54,4 +54,13 @@
assert ok?
refute_empty Nokogiri::HTML(body).search("//div[@class = 'highlight']/pre")
end
+
+ it "should include a valid css helper for pygments" do
+ mock_app
+ get('/pygments.css')
+ assert ok?
+
+ assert_match /text\/css/, content_type
+ assert_empty validate_css(body).errors
+ end
end
View
10 spec/spec_helper.rb
@@ -8,6 +8,7 @@
require 'rack/test'
require 'sinatra/base'
require 'erb'
+require 'w3c_validators'
Sinatra::Base.set :environment, :test
Sinatra::Base.set :views, File.expand_path('../glorify', __FILE__)
@@ -15,6 +16,7 @@
class MiniTest::Spec
include Rack::Test::Methods
+ include W3CValidators
def mock_app(base=Sinatra::Base, &block)
@app = Sinatra.new(base, &block)
@@ -31,4 +33,12 @@ def body
def ok?
last_response.ok?
end
+
+ def content_type
+ last_response.headers['Content-Type']
+ end
+
+ def validate_css(css)
+ CSSValidator.new.validate_text css
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.