Skip to content

Commit

Permalink
Merge pull request #223 from colinbruce/remove-file-exists-deprecation
Browse files Browse the repository at this point in the history
Update File.exists? reference
  • Loading branch information
adamstegman authored Jun 28, 2022
2 parents 0015c92 + 4226350 commit 3c5aeb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/devise_saml_authenticatable/saml_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def file_based_config
return @file_based_config if @file_based_config
idp_config_path = "#{Rails.root}/config/idp.yml"

if File.exists?(idp_config_path)
if File.exist?(idp_config_path)
@file_based_config ||= OneLogin::RubySaml::Settings.new(YAML.load(File.read(idp_config_path))[Rails.env])
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/devise_saml_authenticatable/saml_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
context "when config/idp.yml does not exist" do
before do
allow(Rails).to receive(:root).and_return("/railsroot")
allow(File).to receive(:exists?).with("/railsroot/config/idp.yml").and_return(false)
allow(File).to receive(:exist?).with("/railsroot/config/idp.yml").and_return(false)
end

it "is the global devise SAML config" do
Expand Down Expand Up @@ -156,7 +156,7 @@ def self.settings(idp_entity_id)
before do
allow(Rails).to receive(:env).and_return("environment")
allow(Rails).to receive(:root).and_return("/railsroot")
allow(File).to receive(:exists?).with("/railsroot/config/idp.yml").and_return(true)
allow(File).to receive(:exist?).with("/railsroot/config/idp.yml").and_return(true)
allow(File).to receive(:read).with("/railsroot/config/idp.yml").and_return(idp_yaml)
end

Expand Down

0 comments on commit 3c5aeb6

Please sign in to comment.