zoanthid 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49690abea7d3246fb8df6100ccdfa69feee81aa7
4
- data.tar.gz: 4fd32c1ca35cef13cfc0b26ce9267afd20181552
3
+ metadata.gz: 863b544bc9f2f67747212ec4ecf9fef76cb3abc9
4
+ data.tar.gz: d40fc9dcbc113fc1b70ecdd4daf7341d5a3bd189
5
5
  SHA512:
6
- metadata.gz: d3227461bfd117bcaecd629182dd9bc2cb3803edcdf87eec174b1a9f850303fd1fa7d64359eab073a007f0e7f222bdb64885ba421519d5cf9c54a2451c55b96b
7
- data.tar.gz: 5a6ab77445fb436f231869c309d54ff4920c0b4191122d74d283f8e108d6a25fb1b944354fed815f55cad5d8aef36c0708de3b027a0a577e5ac43d9b29d25a11
6
+ metadata.gz: 967f16567f5599f0c293842c7b36caaffa4ed1153a506501129ee188c11f175fe971d83c9d2098cdc4097793dd64360fdb3790e550b1853a1377f80847320632
7
+ data.tar.gz: 28f668798b9b7572cf7eb2e5e8d99b785656e98fc4143963f231de5fb769a5325ab4b4c77ea73ea1428bba388d411b9013c8b4dfb145664deb56ca7f047fc15b
data/CHANGES.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changes
2
2
 
3
+ ## 0.1.2
4
+
5
+ * Clarify `README`. - Ben Hamill
6
+ * Fix bug in `Zoanthid::ExampleGroup` that caused it to not properly set the
7
+ type and default host name for specs. - Ben Hamill
8
+ * Over-write the 'request' spec type with 'api' because reasons. - Ben Hamill
9
+
3
10
  ## 0.1.1
4
11
 
5
12
  * Remove erroneously committed file. - Ben Hamill
data/README.md CHANGED
@@ -13,14 +13,22 @@ deal with the responses. It's not configurable at this juncture.
13
13
 
14
14
  This will most likely change, but here's the idea so far:
15
15
 
16
- Require Zoanthid in your spec_helper.rb, then if you put spec files in
17
- `spec/api/`, or label them with `type: :api` and you'll get some helpers.
16
+ Your `spec/spec_helper.rb` should have something like this:
17
+
18
+ ``` ruby
19
+ require 'zoanthid/rspec'
20
+
21
+ Zoanthid.app = Rails.application
22
+ ```
23
+
24
+ Then if you put spec files in `spec/api/`, or label them with `type: :api` and
25
+ you'll get some helpers like this:
18
26
 
19
27
  ``` ruby
20
28
  describe "listing posts" do
21
29
  before do
22
30
  get :root
23
- get expand_uri(:posts)
31
+ get expand_link(:posts)
24
32
  end
25
33
 
26
34
  it "shows the total" do
@@ -11,7 +11,7 @@ class Zoanthid::Browser
11
11
 
12
12
  REQUEST_METHODS.each do |verb|
13
13
  define_method verb do |*args, &block|
14
- history << Cetacean.new(client.send verb, *args, &block)
14
+ history << Cetacean.new(client.send(verb, *args, &block))
15
15
  end
16
16
  end
17
17
 
@@ -2,11 +2,11 @@ module Zoanthid
2
2
  module ExampleGroup
3
3
  DEFAULT_HOST = "www.example.com"
4
4
 
5
- def included(base)
6
- metadata[:type] = :api
5
+ def self.included(base)
6
+ base.metadata[:type] = :api
7
7
 
8
- if respond_to?(:default_url_options)
9
- default_url_options[:host] ||= Zoanthid::ExampleGroup::DEFAULT_HOST
8
+ if base.respond_to?(:default_url_options)
9
+ base.default_url_options[:host] ||= Zoanthid::ExampleGroup::DEFAULT_HOST
10
10
  end
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ RSpec.configure do |config|
6
6
  Zoanthid::ExampleGroup,
7
7
  type: :api,
8
8
  example_group: ->(example_group, metadata) do
9
- metadata[:type].nil? && config.escaped_path(%w[spec api]) =~ example_group[:file_path]
9
+ (metadata[:type].nil? || metadata[:type] == :request) && config.escaped_path(%w[spec api]) =~ example_group[:file_path]
10
10
  end
11
11
  )
12
12
 
@@ -1,3 +1,3 @@
1
1
  module Zoanthid
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoanthid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hamill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-29 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.0.3
157
+ rubygems_version: 2.0.14
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Kinda like Capybara for your HAL APIs.