Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

should include a valid css helper for pygments

  • Loading branch information...
commit 2fb1c5821cc7432d193edf529642ae4b9bf2b3b8 1 parent 4209728
Zachary Scott authored
1  glorify.gemspec
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
22 22 s.add_development_dependency "minitest"
23 23 s.add_development_dependency "rack-test"
24 24 s.add_development_dependency "rake"
  25 + s.add_development_dependency "w3c_validators"
25 26 end
9 spec/glorify_spec.rb
@@ -54,4 +54,13 @@
54 54 assert ok?
55 55 refute_empty Nokogiri::HTML(body).search("//div[@class = 'highlight']/pre")
56 56 end
  57 +
  58 + it "should include a valid css helper for pygments" do
  59 + mock_app
  60 + get('/pygments.css')
  61 + assert ok?
  62 +
  63 + assert_match /text\/css/, content_type
  64 + assert_empty validate_css(body).errors
  65 + end
57 66 end
10 spec/spec_helper.rb
@@ -8,6 +8,7 @@
8 8 require 'rack/test'
9 9 require 'sinatra/base'
10 10 require 'erb'
  11 +require 'w3c_validators'
11 12
12 13 Sinatra::Base.set :environment, :test
13 14 Sinatra::Base.set :views, File.expand_path('../glorify', __FILE__)
@@ -15,6 +16,7 @@
15 16
16 17 class MiniTest::Spec
17 18 include Rack::Test::Methods
  19 + include W3CValidators
18 20
19 21 def mock_app(base=Sinatra::Base, &block)
20 22 @app = Sinatra.new(base, &block)
@@ -31,4 +33,12 @@ def body
31 33 def ok?
32 34 last_response.ok?
33 35 end
  36 +
  37 + def content_type
  38 + last_response.headers['Content-Type']
  39 + end
  40 +
  41 + def validate_css(css)
  42 + CSSValidator.new.validate_text css
  43 + end
34 44 end

0 comments on commit 2fb1c58

Please sign in to comment.
Something went wrong with that request. Please try again.