spec/rapidash/clientable_spec.rb in rapidash-0.0.4 vs spec/rapidash/clientable_spec.rb in rapidash-0.0.5
- old
+ new
@@ -8,10 +8,18 @@
class HTTPClientTester
include Rapidash::Clientable
method :http
end
+class HTTPClientPatchTester < HTTPClientTester
+ use_patch
+end
+
+class HTTPClientExtensionTester < HTTPClientTester
+ extension :json
+end
+
class TestClientTester
include Rapidash::Clientable
method :test
end
@@ -50,8 +58,20 @@
method :invalid
end
}.to raise_error(Rapidash::ConfigurationError)
end
+ end
+
+ describe "#use_patch" do
+ it "should set the patch variable to true" do
+ HTTPClientPatchTester.new.class.instance_variable_get(:@patch).should eql(true)
+ end
+ end
+
+ describe "#extension" do
+ it "should set the url_extension variable" do
+ HTTPClientExtensionTester.new.class.instance_variable_get(:@url_extension).should eql(:json)
+ end
end
end