Browse Source
* feat: update application to use non paas and paas configuration services, add helper to determine if platform is paas feat: don't double-instantiate the configuration service feat: add self. to is_paas? definition, and require module in rack_attack chore: lint * test: update suite to work with new paas/env config service logic test: new PlatformHelper * fix: update full import tests to check paas and non-paas config services * fix: update test descriptions and remove unrequired line --------- Co-authored-by: Sam Seed <sam.seed@softwire.com>pull/1838/head
Chirag-Bhatti
1 year ago
committed by
GitHub
14 changed files with 79 additions and 17 deletions
@ -0,0 +1,5 @@
|
||||
module PlatformHelper |
||||
def self.is_paas? |
||||
!ENV["VCAP_SERVICES"].nil? |
||||
end |
||||
end |
@ -0,0 +1,15 @@
|
||||
require "rails_helper" |
||||
|
||||
RSpec.describe PlatformHelper do |
||||
describe "is_paas?" do |
||||
it "returns true if the VCAP_SERVICES environment variable exists" do |
||||
allow(ENV).to receive(:[]).with("VCAP_SERVICES").and_return("dummy") |
||||
expect(described_class.is_paas?).to eq(true) |
||||
end |
||||
|
||||
it "returns false if the VCAP_SERVICES environment variable doesn't exist" do |
||||
allow(ENV).to receive(:[]).with("VCAP_SERVICES") |
||||
expect(described_class.is_paas?).to eq(false) |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue