From b6602d4b880fbce2b6aafed1239b5516cb301155 Mon Sep 17 00:00:00 2001 From: Jim Date: Fri, 16 Oct 2015 11:20:52 +0800 Subject: [PATCH 1/2] Fix ArgumentError: comparison of String with Time failed error for previous_redirect_to_cas --- lib/casclient/frameworks/rails/filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/casclient/frameworks/rails/filter.rb b/lib/casclient/frameworks/rails/filter.rb index 2ab71780..073b0e4d 100644 --- a/lib/casclient/frameworks/rails/filter.rb +++ b/lib/casclient/frameworks/rails/filter.rb @@ -255,7 +255,7 @@ def redirect_to_cas_for_authentication(controller) end if controller.session[:previous_redirect_to_cas] && - controller.session[:previous_redirect_to_cas] > (Time.now - 1.second) + controller.session[:previous_redirect_to_cas].to_time > (Time.now - 1.second) log.warn("Previous redirect to the CAS server was less than a second ago. The client at #{controller.request.remote_ip.inspect} may be stuck in a redirection loop!") controller.session[:cas_validation_retry_count] ||= 0 From d7e9e0d20274e34d0325dff2b29b1fd9798d9a21 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 19 Oct 2015 10:17:53 +0800 Subject: [PATCH 2/2] Fix Formatter 'nested' unknown - maybe you meant 'documentation' or 'progress'?. (ArgumentError), and fix spec test be_true. --- .rspec | 2 +- Appraisals | 5 +++++ gemfiles/rails23.gemfile | 12 +++++++++++- gemfiles/rails30.gemfile | 12 +++++++++++- gemfiles/rails31.gemfile | 12 +++++++++++- gemfiles/rails32.gemfile | 12 +++++++++++- spec/casclient/client_spec.rb | 6 +++--- 7 files changed, 53 insertions(+), 8 deletions(-) diff --git a/.rspec b/.rspec index 42f32465..8c18f1ab 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,2 @@ ---format nested +--format documentation --color diff --git a/Appraisals b/Appraisals index 5c4fae9f..c3ab95db 100644 --- a/Appraisals +++ b/Appraisals @@ -14,4 +14,9 @@ appraise "rails32" do gem "rails", "~> 3.2.8" end +#appraise "rails42" do +# gem "rails", "~> 4.2.0" +# gem 'activerecord-session_store'#, github: 'rails/activerecord-session_store' +#end + # vim: filetype=ruby diff --git a/gemfiles/rails23.gemfile b/gemfiles/rails23.gemfile index 7ce46cb8..419db184 100644 --- a/gemfiles/rails23.gemfile +++ b/gemfiles/rails23.gemfile @@ -2,6 +2,16 @@ source "http://rubygems.org" +gem "rubysl", :platform => :rbx gem "activesupport", "~> 2.3.11" -gemspec :path=>"../" \ No newline at end of file +group :tools do + gem "guard" + gem "guard-rspec" + gem "guard-bundler" + gem "fuubar" + gem "rb-fsevent" + gem "ruby_gntp", :group => :darwin +end + +gemspec :path => "../" diff --git a/gemfiles/rails30.gemfile b/gemfiles/rails30.gemfile index 650920ed..33e738c2 100644 --- a/gemfiles/rails30.gemfile +++ b/gemfiles/rails30.gemfile @@ -2,6 +2,16 @@ source "http://rubygems.org" +gem "rubysl", :platform => :rbx gem "rails", "~> 3.0.17" -gemspec :path=>"../" \ No newline at end of file +group :tools do + gem "guard" + gem "guard-rspec" + gem "guard-bundler" + gem "fuubar" + gem "rb-fsevent" + gem "ruby_gntp", :group => :darwin +end + +gemspec :path => "../" diff --git a/gemfiles/rails31.gemfile b/gemfiles/rails31.gemfile index a9c76694..ed115067 100644 --- a/gemfiles/rails31.gemfile +++ b/gemfiles/rails31.gemfile @@ -2,6 +2,16 @@ source "http://rubygems.org" +gem "rubysl", :platform => :rbx gem "rails", "~> 3.1.8" -gemspec :path=>"../" \ No newline at end of file +group :tools do + gem "guard" + gem "guard-rspec" + gem "guard-bundler" + gem "fuubar" + gem "rb-fsevent" + gem "ruby_gntp", :group => :darwin +end + +gemspec :path => "../" diff --git a/gemfiles/rails32.gemfile b/gemfiles/rails32.gemfile index c0365f00..2b91070e 100644 --- a/gemfiles/rails32.gemfile +++ b/gemfiles/rails32.gemfile @@ -2,6 +2,16 @@ source "http://rubygems.org" +gem "rubysl", :platform => :rbx gem "rails", "~> 3.2.8" -gemspec :path=>"../" \ No newline at end of file +group :tools do + gem "guard" + gem "guard-rspec" + gem "guard-bundler" + gem "fuubar" + gem "rb-fsevent" + gem "ruby_gntp", :group => :darwin +end + +gemspec :path => "../" diff --git a/spec/casclient/client_spec.rb b/spec/casclient/client_spec.rb index 98a52ac3..ffd09445 100644 --- a/spec/casclient/client_spec.rb +++ b/spec/casclient/client_spec.rb @@ -37,17 +37,17 @@ context "cas server is up" do it "returns false if the server cannot be connected to" do connection.stub(:get).and_raise(Errno::ECONNREFUSED) - client.cas_server_is_up?.should be_false + client.cas_server_is_up?.should be false end it "returns false if the request was not a success" do response.stub :kind_of? => false - client.cas_server_is_up?.should be_false + client.cas_server_is_up?.should be false end it "returns true when the server is running" do response.stub :kind_of? => true - client.cas_server_is_up?.should be_true + client.cas_server_is_up?.should be true end end