active_decorator-rspec 0.0.2 → 0.0.3

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: d55e74efa49b9c7685574667b56204b99e757bf7
4
- data.tar.gz: 8f27b1e6d585653065e4bc0f94ae4a81d8dcf351
3
+ metadata.gz: 43fc89bf099aaa2b815342860ee56f0f48d2c8a0
4
+ data.tar.gz: 20096e35fee8e1e57088bea7c5af1cc52c9bd233
5
5
  SHA512:
6
- metadata.gz: 229aa66fa1e8e507c038e212824597643b82a17450314a097616adb01579796f226f52eb9233cdc11887d50349f75d371456c21903eb48767ac1d3cbdb810fc2
7
- data.tar.gz: 1857f5b82924fa65bfcd06ff39c6e659f22f3a5ec103b1a72f7cfc12bab153680b7f4caebf1009db929bd66b7bbd06a68d7e0ea788d41930564f2ee9cfc0e02f
6
+ metadata.gz: dbe3a8092dca16647cc9ee23c30a0f4bc892514e85905a891c4491ceb5665c645c5d5ed76e5ca19411ec3252a2796e3ecbbb80f1b4c67872ad3eeece3be563a7
7
+ data.tar.gz: 6ff5e600931f6db47b1afa3f4d6ef4346809b7a2ee6c933933f54b279ef9d756d248fe3f358208285eb39312163ecfc2e2255890eafe880aad47a59fb09bffb2
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in active_decorator-rspec.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'coveralls', require: false
8
+ end
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
- describe AuthorDecorator, type: decorator do
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 if example
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
@@ -1,5 +1,5 @@
1
1
  module ActiveDecorator
2
2
  module RSpec
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe AuthorDecorator, type: :decorator do
3
+ describe AuthorDecorator do
4
4
  let(:author) { Author.create(name: "boo") }
5
5
 
6
6
  subject { decorate author }
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
1
4
  require "active_support"
2
5
  require "active_decorator"
3
6
  require "active_decorator/rspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_decorator-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mizokami