specstar-models 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/specstar/models.rb +12 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a395c33cad9f0fbc979bd33b1d7a43a3eb196e4e
4
- data.tar.gz: e701ceb6ad5eeb5ef1b769db321fdd500556413f
3
+ metadata.gz: e3c8ed030c00a7da4e805aede14a08881ee5f7ce
4
+ data.tar.gz: 7d9077c49ca65db597dbc3fc7909d585ff4191f6
5
5
  SHA512:
6
- metadata.gz: 343c163ba5cf9c005ccf7404f9ecbc982daac7363211c0f310e8209de3a25198f3f663ddf09881a2aee5b646289695c697bf47bbec6eb91f238ddffab0d1493b
7
- data.tar.gz: a874b18c046fcf18013bc4a2e9336ea7925f440fba676f66f7e65058460b06d1d817521e1262c32b137900d074db30a8a574f520b8b3cfe0a865c0d7b65020b8
6
+ metadata.gz: 726c1e6d66e5ef9254471413bda9b7dd62e1083eba2c70dd19a56603bfe5d3e2a143f2e864086a3f04ad220408de9f3b2c3b5eb2d803b6913bc1f88202a9df5d
7
+ data.tar.gz: db4dacee8193b89bcc8fe4ad96d5dde0312de174531e7951bc0958329bb227d9f33a7ea6f48dedfd0abeb7e331e60a04e843253e5533ecb17ba79e6a98ac1d43
@@ -157,6 +157,18 @@ module Specstar
157
157
  end
158
158
  end
159
159
  end
160
+
161
+ RSpec::Matchers.define :belong_to do |attr|
162
+ match do |model|
163
+ association = model.class.reflect_on_association(attr)
164
+ association && association.macro == :belongs_to
165
+ end
166
+
167
+ failure_message do |model|
168
+ "expected #{model.class} to belong to #{attr}."
169
+ end
170
+ end
171
+
160
172
  end
161
173
  end
162
174
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specstar-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sujoy Gupta