Fixing the SinatraTest so it does not cause the test suite to stall in JRuby-19mode
This commit is contained in:
parent
b4a9aabe74
commit
aa6fbedc9e
|
@ -28,6 +28,6 @@ Gem::Specification.new do |s|
|
||||||
unless defined?(JRUBY_VERSION)
|
unless defined?(JRUBY_VERSION)
|
||||||
s.add_development_dependency 'sqlite3', '~> 1.2'
|
s.add_development_dependency 'sqlite3', '~> 1.2'
|
||||||
else
|
else
|
||||||
s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', ['>= 1.3.0.beta2', '< 1.4']
|
s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', ['>= 1.3.0.rc1', '< 1.4']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ class BaseApp < Sinatra::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class ModularSinatraTest < ActiveSupport::TestCase
|
class ModularSinatraTest < ActionDispatch::IntegrationTest
|
||||||
include Rack::Test::Methods
|
include Rack::Test::Methods
|
||||||
|
|
||||||
def app
|
def app
|
||||||
|
@ -35,6 +35,7 @@ class ModularSinatraTest < ActiveSupport::TestCase
|
||||||
assert_equal 'Hello', last_response.body
|
assert_equal 'Hello', last_response.body
|
||||||
widget = Widget.first
|
widget = Widget.first
|
||||||
assert_not_nil widget
|
assert_not_nil widget
|
||||||
|
assert_equal 'foo', widget.name
|
||||||
assert_equal 1, widget.versions.size
|
assert_equal 1, widget.versions.size
|
||||||
assert_equal 'foobar', widget.versions.first.whodunnit
|
assert_equal 'foobar', widget.versions.first.whodunnit
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
require 'sinatra'
|
# require 'sinatra/main'
|
||||||
|
|
||||||
# --- Tests for non-modular `Sinatra::Application` style ----
|
# --- Tests for non-modular `Sinatra::Application` style ----
|
||||||
class Sinatra::Application
|
class Sinatra::Application
|
||||||
|
@ -7,7 +7,7 @@ class Sinatra::Application
|
||||||
register Sinatra::PaperTrail # we shouldn't actually need this line if I'm not mistaken but the tests seem to fail without it ATM
|
register Sinatra::PaperTrail # we shouldn't actually need this line if I'm not mistaken but the tests seem to fail without it ATM
|
||||||
|
|
||||||
get '/test' do
|
get '/test' do
|
||||||
Widget.create!(:name => 'foo')
|
Widget.create!(:name => 'bar')
|
||||||
'Hai'
|
'Hai'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class Sinatra::Application
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class SinatraTest < ActiveSupport::TestCase
|
class SinatraTest < ActionDispatch::IntegrationTest
|
||||||
include Rack::Test::Methods
|
include Rack::Test::Methods
|
||||||
|
|
||||||
def app
|
def app
|
||||||
|
@ -36,6 +36,7 @@ class SinatraTest < ActiveSupport::TestCase
|
||||||
assert_equal 'Hai', last_response.body
|
assert_equal 'Hai', last_response.body
|
||||||
widget = Widget.first
|
widget = Widget.first
|
||||||
assert_not_nil widget
|
assert_not_nil widget
|
||||||
|
assert_equal 'bar', widget.name
|
||||||
assert_equal 1, widget.versions.size
|
assert_equal 1, widget.versions.size
|
||||||
assert_equal 'raboof', widget.versions.first.whodunnit
|
assert_equal 'raboof', widget.versions.first.whodunnit
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue