Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_unix_config
- @paste=@good_paste
- @paste.parser=:plaintext
- @paste.body=File.read(RAILS_ROOT + "/test/fixtures/pasties/wgetrc")
- assert_equal 1, @paste.sections.size
- end
- def test_sections
- @paste=@good_paste
- @paste.body=File.read(RAILS_ROOT + "/test/fixtures/pasties/sectioned.txt")
- @sections=@paste.sections
- assert_equal 5, @sections.size
- assert_equal "test.js", @sections[0].title
- assert_equal :javascript, @sections[0].parser
- assert_equal "## test.js [javascript]\nThis is a JS file.", @sections[0].body
- assert_equal "super.rb", @sections[1].title
- assert_equal :ruby, @sections[1].parser
- assert_equal "## super.rb [ruby]\n\ndef super\n \"i'm super\"\nend", @sections[1].body
- assert_equal "smart.sql", @sections[2].title
- assert_equal :sql, @sections[2].parser
- assert_equal "just some random title", @sections[3].title
- assert_equal @paste.parser.to_sym, @sections[3].parser
- assert_equal "invalid parser", @sections[4].title
- assert_equal @paste.parser.to_sym, @sections[4].parser
- end
Add Comment
Please, Sign In to add comment