Skip to content

Commit 53c7fb3

Browse files
committed
get specs running under ruby 2.4.1 and rails 5.1
1 parent 92610fa commit 53c7fb3

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ group :ldap do
88
end
99

1010
group :active_resource do
11-
gem "activeresource", ">= 2.3.12", "< 4.0"
11+
gem "activeresource", ">= 2.3.12", "< 5.2"
1212
end

db/migrate/001_create_initial_structure.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateInitialStructure < ActiveRecord::Migration
1+
class CreateInitialStructure < ActiveRecord::Migration[4.2]
22
def self.up
33
# Oracle table names cannot exceed 30 chars...
44
# See http://code.google.com/p/rubycas-server/issues/detail?id=15

db/migrate/002_add_indexes_for_performance.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class AddIndexesForPerformance < ActiveRecord::Migration
1+
class AddIndexesForPerformance < ActiveRecord::Migration[4.2]
22
def self.up
33
add_index :casserver_lt, :ticket
44
add_index :casserver_st, :ticket

lib/casserver/model/consumable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ def cleanup(max_lifetime, max_unconsumed_lifetime)
1818
Time.now - max_lifetime,
1919
Time.now - max_unconsumed_lifetime]
2020

21-
expired_tickets_count = count(:conditions => conditions)
21+
expired_tickets_count = where(conditions).count
2222

2323
$LOG.debug("Destroying #{expired_tickets_count} expired #{self.name.demodulize}"+
2424
"#{'s' if expired_tickets_count > 1}.") if expired_tickets_count > 0
2525

26-
destroy_all(conditions)
26+
where(conditions).destroy_all
2727
end
2828
end
2929
end

lib/casserver/server.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,8 @@ def self.init_database!
532532
st.destroy
533533
end
534534

535-
pgts = CASServer::Model::ProxyGrantingTicket.find(:all,
536-
:conditions => [CASServer::Model::ServiceTicket.quoted_table_name+".username = ?", tgt.username],
537-
:include => :service_ticket)
535+
pgts = CASServer::Model::ProxyGrantingTicket.where(casserver_st: { username: tgt.username }).
536+
joins(:service_ticket)
538537
pgts.each do |pgt|
539538
$LOG.debug("Deleting Proxy-Granting Ticket '#{pgt}' for user '#{pgt.service_ticket.username}'")
540539
pgt.destroy

rubycas-server.gemspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ $gemspec = Gem::Specification.new do |s|
2626
s.has_rdoc = true
2727
s.post_install_message = "For more information on RubyCAS-Server, see http://rubycas.github.com"
2828

29-
s.add_dependency("activerecord", ">= 2.3.12", "< 4.0")
30-
s.add_dependency("activesupport", ">= 2.3.12", "< 4.0")
29+
s.add_dependency("activerecord", ">= 3.0", "< 5.2")
30+
s.add_dependency("activesupport", ">= 3.0", "< 5.2")
3131
s.add_dependency("sinatra", "~> 1.0")
32-
s.add_dependency("sinatra-r18n", '~> 1.1.0')
32+
s.add_dependency("sinatra-r18n", '~> 2.1.7')
3333
s.add_dependency("crypt-isaac", "~> 0.9.1")
3434

3535
s.add_development_dependency("rack-test")
3636
s.add_development_dependency("capybara", '1.1.2')
3737
s.add_development_dependency("rspec")
3838
s.add_development_dependency("rspec-core")
39-
s.add_development_dependency("rake", "0.8.7")
39+
s.add_development_dependency("rake", "~> 11.0")
4040
s.add_development_dependency("sqlite3", "~> 1.3.1")
4141
s.add_development_dependency("appraisal", "~> 0.4.1")
4242
s.add_development_dependency("guard", "~> 1.4.0")

spec/casserver/utils_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ module CASServer
1111
let(:params_with_password_filtered) { { 'password' => '******' } }
1212

1313
it 'should log the controller action' do
14-
$LOG.should_receive(:debug).with 'Processing application::instance_eval {}'
14+
$LOG.should_receive(:<<).with "\n"
15+
$LOG.should_receive(:debug).with 'Processing application::instance_exec {}'
1516

1617
subject.log_controller_action('application', params)
1718
end
1819

1920
it 'should filter password parameters in the log' do
20-
$LOG.should_receive(:debug).with "Processing application::instance_eval #{params_with_password_filtered.inspect}"
21+
$LOG.should_receive(:<<).with "\n"
22+
$LOG.should_receive(:debug).with "Processing application::instance_exec #{params_with_password_filtered.inspect}"
2123

2224
subject.log_controller_action('application', params_with_password)
2325
end

0 commit comments

Comments
 (0)