spec/veritrans_config_spec.rb in veritrans-2.0.0 vs spec/veritrans_config_spec.rb in veritrans-2.0.2
- old
+ new
@@ -43,6 +43,17 @@
data = Veritrans.config.load_config("./spec/configs/veritrans.yml")
data.should == {"client_key" => "test_client_key", "server_key" => "test_server_key"}
end
-end
\ No newline at end of file
+ it "should validate http_params type" do
+ expect {
+ Veritrans.config.http_options = nil
+ }.to raise_error(ArgumentError, "http_options should be a hash")
+ end
+
+ it "should validate http_params type" do
+ expect {
+ Veritrans.config.http_options = {foo: "bar", tcp_nodelay: true}
+ }.to raise_error(ArgumentError, /http_options contain unsupported keys: \[:foo\]/)
+ end
+end