Permalink
Browse files

mend

  • Loading branch information...
1 parent 12d9583 commit 2c1701db6600e5e14762a1d7fd30b68d7b917a3e Davis W. Frank committed Dec 4, 2011
Showing with 16 additions and 4 deletions.
  1. +16 −4 spec/lib/code_map_spec.rb
View
@@ -64,19 +64,19 @@ def a_method(options)
end
it "should find and encode a code block in @@@" do
- code_id =@map.nodes.keys[0]
+ code_id = @map.nodes.keys[0]
@html = Nokogiri(@map[code_id])
- @html.css('textarea').length.should == 1
+ @html.css('textarea.code').length.should == 1
@html.css('textarea').attr('mode').value.should == 'ruby'
@html.css('textarea').text.should match(/a_method/)
end
it "should find a code block in ```" do
- code_id =@map.nodes.keys[1]
+ code_id = @map.nodes.keys[1]
@html = Nokogiri(@map[code_id])
- @html.css('textarea').length.should == 1
+ @html.css('textarea.code').length.should == 1
@html.css('textarea').attr('mode').value.should == 'Markdown'
@html.css('textarea').text.should match(/I'm an H1/)
end
@@ -90,4 +90,16 @@ def a_method(options)
@map.length.should == 2
end
end
+
+ describe "#put_code_in" do
+
+ before :each do
+ converted = "<div>#{@map.put_code_in(@text)}</div>"
+ @doc = Nokogiri(converted)
+ end
+
+ it "should put the highligheted code back into the html" do
+ @doc.css('textarea.code').length.should == 2
+ end
+ end
end

0 comments on commit 2c1701d

Please sign in to comment.