spec/api-client/configuration_spec.rb in api-client-1.10.0 vs spec/api-client/configuration_spec.rb in api-client-2.0.0.rc1

- old
+ new

@@ -1,19 +1,25 @@ require 'spec_helper' describe ApiClient::Configuration do describe "#path" do describe "when not configured" do + before :each do + ApiClient.configure do |config| + config.path = "" + end + end + it "should raise an error" do lambda { ApiClient.config.path }.should raise_error(ApiClient::Exceptions::NotConfigured) end end describe "when properly configured" do before :each do ApiClient.configure do |config| - config.path = "api.example.com" + config.path = "http://api.example.com" end end it "should return the path value" do ApiClient.config.path.should_not be_nil @@ -22,24 +28,24 @@ end describe "#path=" do describe "with a string without '/'" do before :each do - ApiClient.config.path = "api.example.com" + ApiClient.config.path = "http://api.example.com" end it "should set it with a '/'" do - ApiClient.config.path.should == "api.example.com/" + ApiClient.config.path.should == "http://api.example.com/" end end describe "with a string with '/'" do before :each do - ApiClient.config.path = "api.example.com/" + ApiClient.config.path = "http://api.example.com/" end it "should set it as passed" do - ApiClient.config.path.should == "api.example.com/" + ApiClient.config.path.should == "http://api.example.com/" end end end end