grape-juice 0.0.1 → 0.0.2

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: 562a3468b3300d849951665338c975130a5db9c2
4
- data.tar.gz: 60940ebfa1a1cefbfdbc08cd7e9b378db0c25efe
3
+ metadata.gz: c094b2c33c2a7268f4ba241c9f97d69bbd672d02
4
+ data.tar.gz: 787f98eb95fade70d32a4b8876cd4a1e6e56eb1e
5
5
  SHA512:
6
- metadata.gz: e8af2fedbbf3c05901cd659ffb4b74004f3b329b358d60aca3739f3a47a7e5a0490658bb5cae6b984008c1221d419e6baba683255d8f77252fbd923ce457edfb
7
- data.tar.gz: e09f27e11a44e94907038840287354f56abee3e0bfd355eb32ad91186623939fc679762fe417e819b98abf38003f5c73ce58bfd34457f32570696efcee237f17
6
+ metadata.gz: 8bd40fce4c4f073bbdc3ccd70330e67d65dd5fb490f566f21f1cc5c097003f1181ceb5574739a352f7ee971aefe0a4143c7b3e0674ce3a9f9192044459311b57
7
+ data.tar.gz: 216ba12793f24b3be414bce95fa9f1a03cf747d76d8f37ac2c6c37cd40b2dfe8329c35706be8e586409530261897cf403257b00978ee5d31a5e4aca80a2e136c
@@ -19,6 +19,7 @@ module GrapeJuice
19
19
  as_correct? &&
20
20
  if_conditions_correct? &&
21
21
  unless_conditions_correct? &&
22
+ using_correct? &&
22
23
  format_correct? &&
23
24
  safe_correct?
24
25
  end
@@ -132,6 +133,17 @@ module GrapeJuice
132
133
  end
133
134
  end
134
135
 
136
+ def using_correct?
137
+ return true if @using_entity.nil?
138
+
139
+ if exposure[:using] != @using_entity
140
+ @failure_message = "Expected to use #{@using_entity} for exposure, but got #{exposure[:using] || 'nil'}"
141
+ false
142
+ else
143
+ true
144
+ end
145
+ end
146
+
135
147
  def format_correct?
136
148
  return true if @formatter.nil?
137
149
 
@@ -1,3 +1,3 @@
1
1
  module GrapeJuice
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -3,13 +3,19 @@ require 'spec_helper'
3
3
  describe GrapeJuice::ExposeMatcher do
4
4
 
5
5
  context "rspec integration" do
6
+ class AddressEntity
7
+ end
6
8
  class PersonEntity < Grape::Entity
7
9
  expose :name
10
+
11
+ expose :address, using: AddressEntity
12
+
8
13
  end
9
14
 
10
15
  subject { PersonEntity }
11
16
 
12
17
 
13
18
  it { is_expected.to expose(:name) }
19
+ it { is_expected.to expose(:address).using(AddressEntity) }
14
20
  end
15
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-juice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick DeLuca