Skip to content
This repository has been archived by the owner on Apr 6, 2018. It is now read-only.

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
Davis W. Frank committed Dec 4, 2011
1 parent 12d9583 commit 2c1701d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions spec/lib/code_map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.