Sha256: 84c8f2ea9aa810db2bd09df46e9902fd45b33ab83984a671751bcb85541d91b8

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

require 'test_helper.rb'

#
# TestClass for ApplicationRouter
#
# @author [benny]
#
class ApplicationTest < MiniTest::Unit::TestCase
  include Rack::Test::Methods

  class MockApp
    def call(env = nil)
      [200, {}, ["hello"]]
    end
  end

  def app
  	Rack::Blogengine::Application.new
  end

  def setup
  	@cli = Rack::Blogengine::CommandLineInterface.new
    capture_stdout { @cli.generate(testpath) }
    Rack::Blogengine.config = @cli.send(:get_config, testpath)
    Rack::Blogengine.documents = Rack::Blogengine::DocumentParser.parse_in_documents(testpath)
  end

  def test_application_is_callable
  	get '/'

  	assert(last_response.body.include?('This is the Index Page'))
  end

  def teardown
  	system("rm -rf #{testpath}")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-blogengine-0.2.5 test/rack/blogengine/application_test.rb