Sha256: bb0a6d72d6be8401ec4bc994f92c3c8ea286c15cd319d95a04a62baf0c1aceb4

Contents?: true

Size: 902 Bytes

Versions: 4

Compression:

Stored size: 902 Bytes

Contents

require  File.dirname(__FILE__) + '/helper'

APP_DIR = File.dirname(__FILE__) + "/rails_app"
EBB_RAILS = "#{Ebb::LIBDIR}/../bin/ebb_rails"
class EbbRailsTest < Test::Unit::TestCase
  # just to make sure there isn't some load error
  def test_version
    out = %x{ruby #{EBB_RAILS} -v}
    assert_match %r{Ebb #{Ebb::VERSION}}, out
  end
  
  def test_parser
    runner = Ebb::Runner::Rails.new
    runner.parse_options("start -c #{APP_DIR} -p #{TEST_PORT}".split)
    assert_equal TEST_PORT, runner.options[:port].to_i
    assert_equal APP_DIR, runner.options[:root]
  end

  
  def test_start_app
    Thread.new do
      runner = Ebb::Runner::Rails.new
      runner.run("start -c #{APP_DIR} -p #{TEST_PORT}".split)
    end
    sleep 0.1 until Ebb.running?
    
    response = get '/'
    assert_equal 200, response.code.to_i
    
  ensure
    Ebb.stop_server
    sleep 0.1 while Ebb.running?
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
willcannings-ebb-0.2.0 test/ebb_rails_test.rb
ebb-0.1.0 test/ebb_rails_test.rb
ebb-0.2.1 test/ebb_rails_test.rb
ebb-0.2.0 test/ebb_rails_test.rb