remockable 0.3.3 → 0.3.4

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: 9bb3b7e37b2ac626198580bd22c90b9a4c18171f
4
- data.tar.gz: d9073144ae904365b5e5ccb56d27484f81588d5f
3
+ metadata.gz: d3c46052a1d6a43ebacbee804d92a1c3230f1031
4
+ data.tar.gz: 5414cdc33c8f3eac54883961fcaff365b433474b
5
5
  SHA512:
6
- metadata.gz: 35e6b8ed0005b93889b45304868e22dfd57630507f61dc76438b8d8f70dea25cc92dcb0ee6965873de13c976955a309481de3027ce6f657b1c77455dbf802072
7
- data.tar.gz: 7af9f8eaefd19df6e7e318b9e6b9975269dca8b6f720fbebcbe34e556a886ad90e3defab7cda7701d18359f7c4e9cf9cdb53b3beb2267f479689b282442309be
6
+ metadata.gz: e559bb3341b16f1c25c71a6bc55362ed88297f8979530a5b20170c90436e8372adf067442be48dc762049ac16fe530afa66226775a8681326e952ef968ca5fe2
7
+ data.tar.gz: 7077666f3324e348e9214cc43e73303786dcc2e0ea3bb3908ad5cfb738efaf8b8c3979c6d9bdfb511caea5ea3c1eedfe5f023c8e76820afa4dea370f5714300f
data/.travis.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  script: bundle exec rspec
4
+ sudo: false
3
5
 
4
6
  gemfile:
5
7
  - gemfiles/rails_4.2.gemfile
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.4 (2017-04-20)
4
+
5
+ * Fix `allow_values_for` matcher ([Tyler Hunt][tylerhunt])
6
+ * Update `allow_values_for` to use the setter on the object if defined
7
+ ([Tyler Hunt][tylerhunt])
8
+
3
9
  ## 0.3.3 (2017-01-16)
4
10
 
5
11
  * Add `:required`/`:optional` to `belong_to` ([Tyler Hunt][tylerhunt])
data/README.markdown CHANGED
@@ -54,6 +54,7 @@ classes.
54
54
 
55
55
  The following Active Model matchers are supported:
56
56
 
57
+ * `allow_values_for`
57
58
  * `validate_acceptance_of`
58
59
  * `validate_confirmation_of`
59
60
  * `validate_exclusion_of`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- remockable (0.3.3)
4
+ remockable (0.3.4)
5
5
  activemodel (>= 4.0, < 5.1)
6
6
  activerecord (>= 4.0, < 5.1)
7
7
  activesupport (>= 4.0, < 5.1)
@@ -12,28 +12,26 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (4.2.7.1)
16
- activesupport (= 4.2.7.1)
15
+ activemodel (4.2.8)
16
+ activesupport (= 4.2.8)
17
17
  builder (~> 3.1)
18
- activerecord (4.2.7.1)
19
- activemodel (= 4.2.7.1)
20
- activesupport (= 4.2.7.1)
18
+ activerecord (4.2.8)
19
+ activemodel (= 4.2.8)
20
+ activesupport (= 4.2.8)
21
21
  arel (~> 6.0)
22
- activesupport (4.2.7.1)
22
+ activesupport (4.2.8)
23
23
  i18n (~> 0.7)
24
- json (~> 1.7, >= 1.7.7)
25
24
  minitest (~> 5.1)
26
25
  thread_safe (~> 0.3, >= 0.3.4)
27
26
  tzinfo (~> 1.1)
28
- appraisal (2.1.0)
27
+ appraisal (2.2.0)
29
28
  bundler
30
29
  rake
31
30
  thor (>= 0.14.0)
32
31
  arel (6.0.4)
33
32
  builder (3.2.3)
34
- diff-lcs (1.2.5)
35
- i18n (0.7.0)
36
- json (1.8.6)
33
+ diff-lcs (1.3)
34
+ i18n (0.8.1)
37
35
  minitest (5.10.1)
38
36
  rake (12.0.0)
39
37
  rspec-core (3.5.4)
@@ -47,8 +45,8 @@ GEM
47
45
  rspec-support (3.5.0)
48
46
  sqlite3 (1.3.13)
49
47
  thor (0.19.4)
50
- thread_safe (0.3.5)
51
- tzinfo (1.2.2)
48
+ thread_safe (0.3.6)
49
+ tzinfo (1.2.3)
52
50
  thread_safe (~> 0.1)
53
51
 
54
52
  PLATFORMS
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- remockable (0.3.3)
4
+ remockable (0.3.4)
5
5
  activemodel (>= 4.0, < 5.1)
6
6
  activerecord (>= 4.0, < 5.1)
7
7
  activesupport (>= 4.0, < 5.1)
@@ -12,25 +12,25 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (5.0.1)
16
- activesupport (= 5.0.1)
17
- activerecord (5.0.1)
18
- activemodel (= 5.0.1)
19
- activesupport (= 5.0.1)
15
+ activemodel (5.0.2)
16
+ activesupport (= 5.0.2)
17
+ activerecord (5.0.2)
18
+ activemodel (= 5.0.2)
19
+ activesupport (= 5.0.2)
20
20
  arel (~> 7.0)
21
- activesupport (5.0.1)
21
+ activesupport (5.0.2)
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
23
  i18n (~> 0.7)
24
24
  minitest (~> 5.1)
25
25
  tzinfo (~> 1.1)
26
- appraisal (2.1.0)
26
+ appraisal (2.2.0)
27
27
  bundler
28
28
  rake
29
29
  thor (>= 0.14.0)
30
30
  arel (7.1.4)
31
- concurrent-ruby (1.0.4)
32
- diff-lcs (1.2.5)
33
- i18n (0.7.0)
31
+ concurrent-ruby (1.0.5)
32
+ diff-lcs (1.3)
33
+ i18n (0.8.1)
34
34
  minitest (5.10.1)
35
35
  rake (12.0.0)
36
36
  rspec-core (3.5.4)
@@ -44,8 +44,8 @@ GEM
44
44
  rspec-support (3.5.0)
45
45
  sqlite3 (1.3.13)
46
46
  thor (0.19.4)
47
- thread_safe (0.3.5)
48
- tzinfo (1.2.2)
47
+ thread_safe (0.3.6)
48
+ tzinfo (1.2.3)
49
49
  thread_safe (~> 0.1)
50
50
 
51
51
  PLATFORMS
@@ -1,11 +1,18 @@
1
- RSpec::Matchers.define(:allow_values_for) do |*attribute_and_values|
1
+ RSpec::Matchers.define(:allow_values_for) do
2
+ include Remockable::ActiveModel::Helpers
3
+
2
4
  def values
3
5
  expected_as_array[1..-1]
4
6
  end
5
7
 
6
8
  match do |actual|
7
9
  values.all? do |value|
8
- allow(subject).to receive(attribute).and_return(value)
10
+ if subject.respond_to?(:"#{attribute}=")
11
+ subject.send(:"#{attribute}=", value)
12
+ else
13
+ allow(subject).to receive(attribute).and_return(value)
14
+ end
15
+
9
16
  subject.valid?
10
17
  subject.errors[attribute].empty?
11
18
  end
@@ -4,9 +4,7 @@ RSpec::Matchers.define(:have_column) do
4
4
  valid_options %w(default limit null precision scale type)
5
5
 
6
6
  def column
7
- @column ||= subject.class.columns.detect { |column|
8
- column.name == attribute.to_s
9
- }
7
+ @column ||= subject.class.columns_hash[attribute.to_s]
10
8
  end
11
9
 
12
10
  match do |actual|
@@ -1,3 +1,3 @@
1
1
  module Remockable
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remockable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Hunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  requirements: []
248
248
  rubyforge_project:
249
- rubygems_version: 2.5.2
249
+ rubygems_version: 2.6.8
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: A collection of RSpec matchers for web apps.