http_stub 0.16.0.pre1 → 0.17.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +13 -5
  2. data/lib/http_stub.rb +10 -5
  3. data/lib/http_stub/configurer.rb +1 -21
  4. data/lib/http_stub/configurer/dsl/{sanctioned.rb → server.rb} +7 -1
  5. data/lib/http_stub/configurer/dsl/stub_builder.rb +4 -0
  6. data/lib/http_stub/configurer/request/stub.rb +1 -0
  7. data/lib/http_stub/configurer/server/command_processor.rb +3 -3
  8. data/lib/http_stub/rake/server_tasks.rb +1 -1
  9. data/lib/http_stub/server/daemon.rb +3 -1
  10. data/lib/http_stub/server/stub/instance.rb +3 -2
  11. data/lib/http_stub/server/stub/json_request_body.rb +35 -0
  12. data/lib/http_stub/server/stub/request_body.rb +44 -0
  13. data/lib/http_stub/server/stub/simple_request_body.rb +23 -0
  14. data/lib/http_stub/server/stub/truthy_request_matcher.rb +23 -0
  15. data/lib/http_stub/server/views/_stub.haml +3 -0
  16. data/lib/http_stub/version.rb +1 -1
  17. data/spec/acceptance/configurer_initialization_spec.rb +1 -1
  18. data/spec/acceptance/stub_body_schema_validation_spec.rb +67 -0
  19. data/spec/acceptance/stub_control_values_spec.rb +2 -2
  20. data/spec/acceptance/stub_spec.rb +1 -1
  21. data/spec/lib/http_stub/configurer/dsl/{sanctioned_spec.rb → server_spec.rb} +34 -15
  22. data/spec/lib/http_stub/configurer/dsl/stub_builder_spec.rb +18 -0
  23. data/spec/lib/http_stub/configurer/request/stub_spec.rb +52 -20
  24. data/spec/lib/http_stub/configurer/server/command_processor_integration_spec.rb +7 -4
  25. data/spec/lib/http_stub/rake/server_tasks_smoke_spec.rb +54 -13
  26. data/spec/lib/http_stub/server/application_integration_spec.rb +22 -2
  27. data/spec/lib/http_stub/server/daemon_integration_spec.rb +1 -1
  28. data/spec/lib/http_stub/server/daemon_spec.rb +50 -2
  29. data/spec/lib/http_stub/server/stub/instance_spec.rb +44 -10
  30. data/spec/lib/http_stub/server/stub/json_request_body_spec.rb +102 -0
  31. data/spec/lib/http_stub/server/stub/request_body_spec.rb +120 -0
  32. data/spec/lib/http_stub/server/stub/simple_request_body_spec.rb +43 -0
  33. data/spec/lib/http_stub/server/stub/string_value_matcher_spec.rb +2 -2
  34. data/spec/lib/http_stub/server/stub/truthy_request_matcher_spec.rb +23 -0
  35. data/spec/lib/http_stub/server/stub/uri_spec.rb +1 -1
  36. data/spec/spec_helper.rb +3 -2
  37. data/spec/support/configurer_integration.rb +2 -2
  38. data/spec/support/stub_fixture.rb +2 -1
  39. metadata +307 -281
  40. data/spec/lib/http_stub/configurer_spec.rb +0 -22
@@ -1,22 +0,0 @@
1
- describe HttpStub::Configurer do
2
-
3
- class TestableConfigurer
4
- include HttpStub::Configurer
5
-
6
- host "some_host"
7
- port "8888"
8
- end
9
-
10
- describe "::get_base_uri" do
11
-
12
- it "returns a uri that combines the provided host and port" do
13
- expect(TestableConfigurer.get_base_uri).to include("some_host:8888")
14
- end
15
-
16
- it "returns a uri accessed via http" do
17
- expect(TestableConfigurer.get_base_uri).to match(/^http:\/\//)
18
- end
19
-
20
- end
21
-
22
- end