spec/hyperdrive/endpoint_spec.rb in hyperdrive-0.0.7 vs spec/hyperdrive/endpoint_spec.rb in hyperdrive-0.0.8

- old
+ new

@@ -17,6 +17,17 @@ it "responds to requests" do get '/', {}, default_rack_env(hyperdrive.resources[:thing]) last_response.successful?.must_equal true end + + it "can raise an HTTPError" do + hyperdrive do + resource(:thing) do + request(:get) do + error(418, "I'M A TEAPOT") + end + end + end + ->{ get '/', {}, default_rack_env(hyperdrive.resources[:thing]) }.must_raise Hyperdrive::Errors::HTTPError + end end