so_stub_very_test 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c98f18e778b94cc8312353b40d917eed8fa2a6c0
4
- data.tar.gz: 73b845747f0b0f01ccf719035096e905683ea035
3
+ metadata.gz: 1ab2e09581e5a95d21c45bc5dcf362eba75dbbb7
4
+ data.tar.gz: 747f711125f10c91436421fc41178be84ee675bd
5
5
  SHA512:
6
- metadata.gz: b81585a91b7c564420cd467b3d0a76bcf43daddd708b133ad8abb22d0ef728d7083422975d654e94cb6a739cd937920940a8829dd85a6e27056b44e73f88a4f0
7
- data.tar.gz: 502736a9beab4a7a42289950bbbd6f4de9c09c3aed8bb354a8d2fb262f9a4c7828b6ca9f27be341e5f337fbeada97ad9f04b804bf3a3ed1084d0ad926b14b804
6
+ metadata.gz: 52732f7b77f26b1e49afdc0089aafa5f3fa74766effb526c0618eab31870c66bbfc0362214e7174874612a7f2588e96fa4d8262536db0005a24863b218c47a17
7
+ data.tar.gz: f1b376fb7c675adc75e7f8248e502961601fe5208d4ae7df46625f6d577130bba380b4caa64af804887c98945749363c6b857330e211637f1ff4c80e60e5c27b
data/README.md CHANGED
@@ -194,7 +194,7 @@ class TestDoges < Minitest::Test
194
194
 
195
195
  def test_the_doge
196
196
  stub_get "/doge", "hi from doge"
197
- assert_equal "hi from doge", Excon.get({ path: "/doge" }).body
197
+ assert_equal "hi from doge", Excon.get("http://www.example.com/doge").body
198
198
  end
199
199
  end
200
200
  ```
@@ -1,3 +1,3 @@
1
1
  module SoStubVeryTest
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -9,7 +9,7 @@ module SoStubVeryTest
9
9
  class NoPathGivenError < StandardError; end
10
10
 
11
11
  def namespace(path, host = nil, &block)
12
- if stub_paths.any? && stub_host != host
12
+ if stub_paths.any? && host && stub_host != host
13
13
  raise MixedNamespacesError, "Namespaces can't be mixed (#{stub_host} and #{host == nil ? "nil" : host})"
14
14
  end
15
15
 
@@ -100,6 +100,15 @@ class TestSoStubVeryTest < Minitest::Test
100
100
  assert_equal Excon.stubs, [[{ path: /\A\/foo\/bar\/baz\Z/, method: :get }, { body: true }]]
101
101
  end
102
102
 
103
+ def test_can_nest_default_host_namespace
104
+ # Will not raise MixedNamespacesError
105
+ SoStubVeryTest.default_host = "foo.example.com"
106
+ namespace "/foo" do
107
+ namespace "/bar" do
108
+ end
109
+ end
110
+ end
111
+
103
112
  def test_can_use_no_path_when_in_namespace
104
113
  namespace "/foo" do
105
114
  stub_get true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: so_stub_very_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Clem