File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,16 @@ def universe_domain= new_ud
119119 end
120120
121121 # Root URL (host/port) for the API
122- # @return [Addressable::URI]
122+ # @return [Addressable::URI, String ]
123123 attr_reader :root_url
124124
125125 # Set the root URL.
126126 # If the given url includes a universe domain substitution, it is
127127 # resolved in the current universe domain
128128 #
129- # @param url_or_template [String] The URL, which can include a universe domain substitution
129+ # @param url_or_template [Addressable::URI, String] The URL, which can include a universe domain substitution
130130 def root_url = url_or_template
131- if url_or_template . include? ENDPOINT_SUBSTITUTION
131+ if url_or_template . is_a? ( String ) && url_or_template . include? ( ENDPOINT_SUBSTITUTION )
132132 @root_url_template = url_or_template
133133 @root_url = url_or_template . gsub ENDPOINT_SUBSTITUTION , universe_domain
134134 else
Original file line number Diff line number Diff line change 533533 expect ( service_ud . root_url ) . to eql "https://endpoint1.mydomain5.com/"
534534 end
535535
536+ it "should support setting root url to Addressable::URI" do
537+ service_ud . root_url = Addressable ::URI . parse ( "https://endpoint1.mydomain5.com/" )
538+ expect ( service_ud . root_url ) . to be_a ( Addressable ::URI )
539+ end
540+
536541 it "should support setting root url to a dynamic value" do
537542 service . universe_domain = "mydomain6.com"
538543 service . root_url = "https://endpoint2.$UNIVERSE_DOMAIN$/"
You can’t perform that action at this time.
0 commit comments