active_decorator-rspec 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/README.md +3 -1
- data/lib/active_decorator/rspec.rb +8 -1
- data/lib/active_decorator/rspec/version.rb +1 -1
- data/spec/decorators/author_decorator_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43fc89bf099aaa2b815342860ee56f0f48d2c8a0
|
4
|
+
data.tar.gz: 20096e35fee8e1e57088bea7c5af1cc52c9bd233
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe3a8092dca16647cc9ee23c30a0f4bc892514e85905a891c4491ceb5665c645c5d5ed76e5ca19411ec3252a2796e3ecbbb80f1b4c67872ad3eeece3be563a7
|
7
|
+
data.tar.gz: 6ff5e600931f6db47b1afa3f4d6ef4346809b7a2ee6c933933f54b279ef9d756d248fe3f358208285eb39312163ecfc2e2255890eafe880aad47a59fb09bffb2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# ActiveDecorator::RSpec
|
2
2
|
|
3
3
|
[![Build Status](https://img.shields.io/travis/mizoR/active_decorator-rspec/master.svg?style=flat)](https://travis-ci.org/mizoR/active_decorator-rspec)
|
4
|
+
[![Coverage Status](https://img.shields.io/coveralls/mizoR/active_decorator-rspec/master.svg?style=flat)](https://coveralls.io/r/mizoR/active_decorator-rspec?branch=master)
|
4
5
|
[![Code Climate](https://img.shields.io/codeclimate/github/mizoR/active_decorator-rspec/badges/gpa.svg?style=flat)](https://codeclimate.com/github/mizoR/active_decorator-rspec)
|
5
6
|
[![Dependency Status](https://img.shields.io/gemnasium/mizoR/active_decorator-rspec.svg?style=flat)](https://gemnasium.com/mizoR/active_decorator-rspec)
|
6
7
|
|
@@ -28,7 +29,8 @@ require "active_decorator/rspec"
|
|
28
29
|
## Usage
|
29
30
|
|
30
31
|
```rb
|
31
|
-
|
32
|
+
# spec/decorators/author_decorator_spec.rb
|
33
|
+
describe AuthorDecorator do
|
32
34
|
let(:author) { Author.create name: 'boo' }
|
33
35
|
subject { decorate author }
|
34
36
|
|
@@ -10,7 +10,7 @@ module ActiveDecorator
|
|
10
10
|
controller.request = ActionController::TestRequest.new
|
11
11
|
ActiveDecorator::ViewContext.current = controller.view_context
|
12
12
|
|
13
|
-
example.extend self
|
13
|
+
example.extend self
|
14
14
|
|
15
15
|
self
|
16
16
|
end
|
@@ -23,6 +23,13 @@ module ActiveDecorator
|
|
23
23
|
end
|
24
24
|
|
25
25
|
RSpec.configure do |config|
|
26
|
+
dir_parts = %w<spec decorators>
|
27
|
+
escaped_path = Regexp.compile(dir_parts.join('[\\\/]') + '[\\\/]')
|
28
|
+
|
29
|
+
config.define_derived_metadata(file_path: escaped_path) do |metadata|
|
30
|
+
metadata[:type] ||= :decorator
|
31
|
+
end
|
32
|
+
|
26
33
|
config.before :each, type: :decorator do
|
27
34
|
ActiveDecorator::RSpec.enable(self)
|
28
35
|
end
|
data/spec/spec_helper.rb
CHANGED