Permalink
Browse files

spec/glorify_spec: it should parse ruby blocks

  • Loading branch information...
1 parent 56c5507 commit 33a3ddd270a4bbd7d0b586457e0eb0a4ecb5608e @zzak committed May 22, 2012
Showing with 19 additions and 1 deletion.
  1. +1 −0 spec/glorify/ruby_blocks.erb
  2. +5 −0 spec/glorify/some_code.md
  3. +12 −1 spec/glorify_spec.rb
  4. +1 −0 spec/spec_helper.rb
@@ -0,0 +1 @@
+<%= glorify(@some_code) %>
@@ -0,0 +1,5 @@
+```ruby
+def in_ruby?
+ return apples.all? { |a| a.to_s == 'ruby' }
+end
+```
View
@@ -27,6 +27,17 @@
end
it "should parse ruby blocks" do
- flunk "NotImplementedError"
+ mock_app do
+ get('/') do
+ @some_code = File.open(
+ File.expand_path('../glorify/some_code.md', __FILE__),
+ "rb"
+ ).read
+ erb :ruby_blocks
+ end
+ end
+ get('/')
+ assert ok?
+ refute_empty Nokogiri::HTML(body).search("//div[@class = 'highlight']/pre")
end
end
View
@@ -4,6 +4,7 @@
require 'rack'
require 'glorify'
+require 'nokogiri'
require 'rack/test'
require 'sinatra/base'
require 'erb'

0 comments on commit 33a3ddd

Please sign in to comment.