Skip to content

Commit 389e32f

Browse files
committed
Add unit tests for SoftLayer::Service#user_agent_header.
1 parent f4e9b30 commit 389e32f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

spec/Service_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,19 @@
286286
end
287287
end
288288

289+
describe SoftLayer::Service, "#user_agent_header" do
290+
it "should return a default value if not set" do
291+
service = SoftLayer::Service.new("SoftLayer_Account", :username => "sample_username", :api_key => "blah")
292+
service.user_agent_header.should_not be_empty
293+
end
294+
295+
it "should persist a set value after being set" do
296+
service = SoftLayer::Service.new("SoftLayer_Account", :username => "sample_username", :api_key => "blah")
297+
service.user_agent_header("foobar").should === {"User-Agent"=>"foobar"}
298+
service.user_agent_header.should === {"User-Agent"=>"foobar"}
299+
end
300+
end
301+
289302
describe SoftLayer::Service, "#result_limit" do
290303
it "should return an APIParameterFilter with itself as the target" do
291304
service = SoftLayer::Service.new("SoftLayer_Account", :username => "sample_username", :api_key => "blah")

0 commit comments

Comments
 (0)