Skip to content

Commit f2e39cb

Browse files
committed
Add method check_url to return the URL to /check
/check is an optional module in BigBlueButton. Also change rspec to be more verbose and include 1.0 in the list of versions tested for.
1 parent 02b317c commit f2e39cb

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
--format documentation
12
--color

lib/bigbluebutton_api.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,10 @@ def test_connection
599599
response[:returncode]
600600
end
601601

602+
def check_url
603+
get_url(:check)
604+
end
605+
602606
# API's are equal if all the following attributes are equal.
603607
def ==(other)
604608
r = true
@@ -624,6 +628,9 @@ def last_xml_response
624628
def get_url(method, params={})
625629
if method == :index
626630
return @url
631+
elsif method == :check
632+
baseurl = URI.join(@url, "/").to_s
633+
return "#{baseurl}check"
627634
end
628635

629636
url = "#{@url}/#{method}?"

spec/bigbluebutton_api_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,15 @@
340340
end
341341
end
342342

343+
describe "#check_url" do
344+
context "when method = :check" do
345+
it {
346+
api.url = 'http://my-test-server.com/bigbluebutton/api'
347+
api.check_url.should == 'http://my-test-server.com/check'
348+
}
349+
end
350+
end
351+
343352
describe "#==" do
344353
let(:api2) { BigBlueButton::BigBlueButtonApi.new(url, secret, version, debug) }
345354

@@ -403,6 +412,13 @@
403412
it { api.get_url(:index).should == api.url }
404413
end
405414

415+
context "when method = :check" do
416+
it {
417+
api.url = 'http://my-test-server.com/bigbluebutton/api'
418+
api.get_url(:check).should == 'http://my-test-server.com/check'
419+
}
420+
end
421+
406422
context "when method != :index" do
407423
context "validates the entire url" do
408424
context "with params" do
@@ -755,4 +771,5 @@
755771
it_should_behave_like "BigBlueButtonApi", "0.8"
756772
it_should_behave_like "BigBlueButtonApi", "0.81"
757773
it_should_behave_like "BigBlueButtonApi", "0.9"
774+
it_should_behave_like "BigBlueButtonApi", "1.0"
758775
end

0 commit comments

Comments
 (0)