Skip to content

Commit

Permalink
Removed old vendored RedCloth in favour of gem.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dunkley committed Sep 3, 2009
1 parent 4d92663 commit e36a0db
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 2,608 deletions.
4 changes: 3 additions & 1 deletion config/environment.rb
Expand Up @@ -15,7 +15,9 @@
config.frameworks -= [ :action_web_service ]

# Add additional load paths for your own custom dirs
config.load_paths += %W( #{RAILS_ROOT}/vendor/RedCloth-3.0.3/lib )
# config.load_paths += %W( #{RAILS_ROOT}/vendor/RedCloth-3.0.3/lib )

config.gem "RedCloth", :version => '= 4.2.0'

# config.controller_paths += %W( #{RAILS_ROOT}/vendor/plugins/routing_navigator/lib )

Expand Down
5 changes: 5 additions & 0 deletions lib/extensions/string_ext.rb
@@ -0,0 +1,5 @@
class String
def to_html
RedCloth.new(self).to_html
end
end
18 changes: 3 additions & 15 deletions test/test_helper.rb
@@ -1,8 +1,9 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require File.expand_path(File.dirname(__FILE__) + '/../config/environment')
require 'test_help'

class Test::Unit::TestCase
class ActiveSupport::TestCase
fixtures :all
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test database remains unchanged so your fixtures don't have to be reloaded
Expand All @@ -23,17 +24,4 @@ class Test::Unit::TestCase
# instantiated fixtures translates to a database query per test method),
# then set this back to true.
self.use_instantiated_fixtures = false


# Add more helper methods to be used by all tests here...
def assert_difference(object, method, difference)
initial_value = object.send(method)
yield
assert_equal initial_value + difference, object.send(method), "#{object}##{method}"
end

def assert_no_difference(object, method, &block)
assert_difference object, method, 0, &block
end

end
7 changes: 2 additions & 5 deletions test/unit/category_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'test_helper'

class CategoryTest < Test::Unit::TestCase
fixtures :categories

# Replace this with your real tests.
class CategoryTest < ActiveSupport::TestCase
def test_truth
assert_kind_of Category, categories(:first)
end
Expand Down
5 changes: 1 addition & 4 deletions test/unit/forum_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class ForumTest < Test::Unit::TestCase
fixtures :forums

# Replace this with your real tests.
class ForumTest < ActiveSupport::TestCase
def test_true
true
end
Expand Down
5 changes: 1 addition & 4 deletions test/unit/image_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class ImageTest < Test::Unit::TestCase
fixtures :images

# Replace this with your real tests.
class ImageTest < ActiveSupport::TestCase
def test_truth
assert true
end
Expand Down
14 changes: 6 additions & 8 deletions test/unit/post_test.rb
@@ -1,16 +1,14 @@
require File.dirname(__FILE__) + '/../test_helper'

class PostTest < Test::Unit::TestCase
fixtures :posts

class PostTest < ActiveSupport::TestCase
def test_create
assert_difference Post, :count, +1 do
assert_difference 'Post.count' do
Post.create(:body => "lorem ipsum")
end
end

def test_script_tags
assert_difference Post, :count, +1 do
assert_difference 'Post.count' do
@post = Post.new(:title => "Tag Test", :body => "<script>alert('hi')</script>")
@post.save
end
Expand All @@ -20,7 +18,7 @@ def test_script_tags
end

def test_pre_tags
assert_difference Post, :count, +1 do
assert_difference('Post.count') do
@post = Post.new(:title => "Tag Test", :body => "<p><pre><anytag>text</anytag></pre></p>")
@post.save
end
Expand All @@ -30,7 +28,7 @@ def test_pre_tags
end

def test_surrounded_tags
assert_difference Post, :count, +1 do
assert_difference 'Post.count' do
@post = Post.new(:title => "Tag Test", :body => "<script>alert('hi')</script><pre><anytag>text</anytag></pre><script>alert('hi')</script>")
@post.save
end
Expand All @@ -41,4 +39,4 @@ def test_surrounded_tags



end
end
2 changes: 1 addition & 1 deletion test/unit/user_mailer_test.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'user_mailer'

class UserMailerTest < Test::Unit::TestCase
class UserMailerTest < ActiveSupport::TestCase
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
CHARSET = "utf-8"

Expand Down
5 changes: 1 addition & 4 deletions test/unit/user_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'

class UserTest < Test::Unit::TestCase
fixtures :users

# Replace this with your real tests.
class UserTest < ActiveSupport::TestCase
def test_truth
assert_kind_of User, users(:admin_hans)
end
Expand Down
3 changes: 0 additions & 3 deletions vendor/RedCloth-3.0.3/bin/redcloth

This file was deleted.

0 comments on commit e36a0db

Please sign in to comment.