Skip to content

Commit 15eef8c

Browse files
committed
Update to rspec 3.1, fix tests, add circleci
wip Update to rspec 3.1, fix tests add more specific gem versions add ruby-version for circleci update ruby version in circle.yml remove .ruby-version file
1 parent f7d7325 commit 15eef8c

File tree

8 files changed

+24
-33
lines changed

8 files changed

+24
-33
lines changed

.ruby-gemset

Lines changed: 0 additions & 1 deletion
This file was deleted.

Gemfile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,2 @@
11
source 'https://rubygems.org'
22
gemspec
3-
4-
group :development do
5-
# for gems that are nice in development
6-
# but don't break the build when missing
7-
# Example: debugger
8-
gem 'byebug'
9-
gem "guard"
10-
gem "guard-rspec"
11-
12-
gem 'rb-inotify', :require => false
13-
gem 'rb-fsevent', :require => false
14-
gem 'rb-fchange', :require => false
15-
end
16-
17-
group :test do
18-
gem 'rake'
19-
gem 'rspec'
20-
end

circle.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
machine:
2+
ruby:
3+
version: 2.1.2

lib/rubycas-server-core.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
require "rubycas-server-core/tickets/validations"
1111

1212
module RubyCAS
13+
def self.root
14+
File.dirname __dir__
15+
end
16+
1317
module Server
1418
module Core
1519
extend self

lib/rubycas-server-core/settings.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ module Settings
1212
attr_reader :_settings
1313

1414
def load!(config)
15+
1516
if config.is_a? String
16-
config = YAML::load_file(config).with_indifferent_access
17+
config_dir = File.join RubyCAS.root, config
18+
@_settings.merge! YAML::load_file(config_dir).with_indifferent_access
1719
elsif config.is_a? Hash
1820
@_settings.merge!(config)
1921
end

rubycas-server-core.gemspec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ Gem::Specification.new do |gem|
1717
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
1818
gem.require_paths = ["lib"]
1919

20-
gem.add_dependency "r18n-core"
21-
gem.add_dependency "activesupport", ">= 3.0"
20+
gem.required_ruby_version = '>= 1.9.2'
21+
gem.required_rubygems_version = '>= 1.3.6'
2222

23-
gem.add_development_dependency "rspec"
24-
gem.add_development_dependency "bundler"
23+
gem.add_dependency 'r18n-core', '~> 2.0.3'
24+
gem.add_dependency 'activesupport', '>= 3.0'
25+
26+
gem.add_development_dependency 'rspec', '~> 3.1.0'
27+
gem.add_development_dependency 'rake', '~> 10.4.2'
28+
gem.add_development_dependency 'bundler', '>= 1.6.0'
2529
end

spec/rubycas-server-core/tickets/validations_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
it "should validate login ticket" do
3030
@lt = Tickets.generate_login_ticket(@client_hostname)
3131
success, error = @cas.validate_login_ticket(@lt.ticket)
32-
success.should be_true
32+
success.should be_truthy
3333
error.should be_nil
3434
end
3535
end
@@ -95,7 +95,7 @@
9595
end
9696

9797
it "does not validate service ticket (throws an error)" do
98-
success, error = @cas.validate_service_ticket(@service, "#{@st.ticket}-random_string")
98+
_, error = @cas.validate_service_ticket(@service, "#{@st.ticket}-random_string")
9999
expect(error).not_to be nil
100100
end
101101
end

spec/rubycas-server-core/tickets_spec.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module RubyCAS::Server::Core
8080
end
8181

8282
it "must generate a ticket that starts with 'ST-'" do
83-
st.ticket.should match /^ST-/
83+
st.ticket.should(match(/^ST-/))
8484
end
8585

8686
it "should assoicate the ST with the supplied TGT" do
@@ -90,18 +90,15 @@ module RubyCAS::Server::Core
9090

9191
describe ".generate_proxy_ticket(target_service, pgt)" do
9292
it "should return a ProxyGrantingTicket" do
93-
pending("Proxy ticket is not implemented yet")
94-
fail
93+
skip('Not supported')
9594
end
9695

9796
it "should not consume the generated ticket" do
98-
pending("Proxy ticket is not implemented yet")
99-
fail
97+
skip('Not supported')
10098
end
10199

102100
it "should start the ticket string with PT-" do
103-
pending("Proxy ticket is not implemented yet")
104-
fail
101+
skip('Not supported')
105102
end
106103
end
107104
end

0 commit comments

Comments
 (0)