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 +4 -4
- data/CHANGES.md +7 -0
- data/README.md +11 -3
- data/lib/zoanthid/browser.rb +1 -1
- data/lib/zoanthid/example_group.rb +4 -4
- data/lib/zoanthid/rspec.rb +1 -1
- data/lib/zoanthid/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 863b544bc9f2f67747212ec4ecf9fef76cb3abc9
|
4
|
+
data.tar.gz: d40fc9dcbc113fc1b70ecdd4daf7341d5a3bd189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
17
|
-
|
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
|
31
|
+
get expand_link(:posts)
|
24
32
|
end
|
25
33
|
|
26
34
|
it "shows the total" do
|
data/lib/zoanthid/browser.rb
CHANGED
@@ -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
|
data/lib/zoanthid/rspec.rb
CHANGED
@@ -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
|
|
data/lib/zoanthid/version.rb
CHANGED
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.
|
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
|
+
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.
|
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.
|