rectify 0.5.2 → 0.5.3

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: ffd5e82c02a959c4d8c766a987d1c792b7429f9c
4
- data.tar.gz: 7b4c4098bf7c3cbe4542b91ba5c5f52cd431107c
3
+ metadata.gz: c2bb5273fec36e8fcb95059c576c8739b203a7b0
4
+ data.tar.gz: 30f1990ccfb972a0dc6f635c039d2517d22e00ee
5
5
  SHA512:
6
- metadata.gz: 6ead461a3c15a5624c0da681619afa11e4d0e9049115e830457d6cdefe5d40279e296eba1f00b71e28c5396e3d51e595b2a717fc080c5768b7fb1df14f055d5b
7
- data.tar.gz: 29b7fe574d3891a8856a4fdebd72385c46b4940c2d3519460862edd03bc8ba7f7a328a1281aeb38725d6f68d6ff1a149593616fe10157350461cc266bbbc442b
6
+ metadata.gz: 77f12965fca9b50e04f7ef748212e15bf9bb1d4b8a717c112273ea6b20246cb7a986fe2010777e9cd6f5ee04fe8f1b9d9a20c257566fadbbabf75d93534c6167
7
+ data.tar.gz: 07b669e588dc729a0d9f3ad55751e5feba642c7e73c88a3806f66f982e3e36d0f5ec4347ea45912ad0ede1975c41c4fb93b42f767a448b7b91a214877c6537b5
@@ -21,7 +21,9 @@ module Rectify
21
21
 
22
22
  private
23
23
 
24
- attr_reader :controller
24
+ def controller
25
+ @controller ||= ActionController::Base.new
26
+ end
25
27
 
26
28
  def view_context
27
29
  @view_context ||= begin
@@ -1,6 +1,8 @@
1
1
  module Rectify
2
2
  module RSpec
3
3
  module Helpers
4
+ include Wisper::RSpec::BroadcastMatcher
5
+
4
6
  def stub_query(query_class, options = {})
5
7
  results = options.fetch(:results, [])
6
8
  allow(query_class).to receive(:new) { StubQuery.new(results) }
@@ -1,15 +1,14 @@
1
1
  module Rectify
2
2
  class StubForm
3
- def initialize(attributes)
4
- @attributes = attributes
5
- end
3
+ attr_reader :attributes
6
4
 
7
- def attributes
8
- @attributes.except!(:valid?)
5
+ def initialize(attributes)
6
+ @valid = attributes.fetch(:valid?, false)
7
+ @attributes = attributes.except!(:valid?)
9
8
  end
10
9
 
11
10
  def valid?
12
- @attributes.fetch(:valid?, false)
11
+ @valid
13
12
  end
14
13
 
15
14
  def invalid?
data/lib/rectify/rspec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require "wisper/rspec/matchers"
2
+
1
3
  require "rectify/rspec/stub_query"
2
4
  require "rectify/rspec/stub_form"
3
5
  require "rectify/rspec/helpers"
@@ -1,3 +1,3 @@
1
1
  module Rectify
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
data/readme.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Code Climate](https://codeclimate.com/github/andypike/rectify/badges/gpa.svg)](https://codeclimate.com/github/andypike/rectify)
4
4
  [![Build Status](https://travis-ci.org/andypike/rectify.svg?branch=master)](https://travis-ci.org/andypike/rectify)
5
+ [![Gem Version](https://badge.fury.io/rb/rectify.svg)](https://badge.fury.io/rb/rectify)
5
6
 
6
7
  Rectify is a gem that provides some lightweight classes that will make it easier
7
8
  to build Rails applications in a more maintainable way. It's built on top of
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rectify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Pike
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.10.3
125
- - !ruby/object:Gem::Dependency
126
- name: wisper-rspec
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.0.2
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.0.2
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: rspec
141
127
  requirement: !ruby/object:Gem::Requirement