condition 0.0.26 → 0.0.27

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: 51e98f4bbd8529a11baa22fe47f06f2496d45d38
4
- data.tar.gz: 3266cdf958fd1ca38025ef74df922d3be1167d69
3
+ metadata.gz: 050b71f7bdf86ef89f20b29f0224d357ffacb789
4
+ data.tar.gz: 9375d2c0dc2a57025ef3591ba9a9139135038832
5
5
  SHA512:
6
- metadata.gz: 48a46b7f0adf7009f6529404ebea19c59750e93c7c739405199969a20633c4a614198f09b56da37ef6ba3388a14d3380946472db52f83336af5cfa8fde3b3787
7
- data.tar.gz: 6a2d78da0d52a248fb04bdd4c98c4c222eb25d431579a86455cfd61f04e84d4f9f1c2bfc8f9b41772d7024ec1c52cbd61d79a900318163501abaf2a55f1e0190
6
+ metadata.gz: 624c722b84ef2d2c6c145d3b6fb3474f650d43fb340b0d6ad5619a39c485fb642b3d578e1903764f78b1e1ac942fcf5ad3e7be8cefa0f1c583e194951b7e7617
7
+ data.tar.gz: 9902d2e5e09f98854e2c99eb45ee7d47bbbd5744461cd1edb10a66ff2f5f11b2c21f61bb75c983031e5dc82d277ac1c3cf818961c83a5708879d948831d70641
data/README.md CHANGED
@@ -30,6 +30,11 @@ TODO: Write usage instructions here
30
30
 
31
31
  ## Changes
32
32
 
33
+ 2014-01-30 0.0.27
34
+ check param.check name not found
35
+ view expected <> real
36
+ view post condition column name in error
37
+
33
38
  2014-01-23 0.0.26
34
39
  modify bug array size check
35
40
  view unmatch hash key
@@ -50,6 +50,7 @@ module Condition
50
50
 
51
51
  def check(name, data)
52
52
  item = item(name)
53
+ raise "#{name} not found in param" if item.nil?
53
54
  item.clear_used_values
54
55
  data.each do |line|
55
56
  item.check_line(line)
@@ -164,7 +164,7 @@ module Condition
164
164
  @unmatch_info = []
165
165
  value.each_pair do |k, v|
166
166
  match = value_match?(v, real[k])
167
- @unmatch_info << v.to_s + " <> " + real[k].to_s if !match
167
+ @unmatch_info << "key=#{k.to_s} " + v.to_s + " <> " + real[k].to_s if !match
168
168
  whereKeyFlag = nil != @options.index(k.to_s)
169
169
  matchFlag = false if !match
170
170
  targetFlag = false if whereKeyFlag && !match
@@ -175,7 +175,7 @@ module Condition
175
175
  elsif !targetFlag
176
176
  return false
177
177
  else
178
- raise "#{@name} not match " + real.to_s + "\n" + @unmatch_info.join("\n")
178
+ raise "#{@name} not match " + real.to_s + "\nexpected <> real\n" + @unmatch_info.join("\n")
179
179
  end
180
180
  end
181
181
 
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Condition
4
- VERSION = "0.0.26"
4
+ VERSION = "0.0.27"
5
5
  end
@@ -25,6 +25,8 @@ describe Condition do
25
25
  expect { param.post(storage) }.to raise_error
26
26
  param = Condition::Param.new(FILES + '/t_user.ods', 5)
27
27
  expect { param.post(storage) }.to raise_error
28
+ param = Condition::Param.new(FILES + '/t_user.ods', 6)
29
+ expect { param.post(storage) }.to raise_error
28
30
  end
29
31
 
30
32
  it 'pre and params' do
@@ -163,4 +165,9 @@ describe Condition do
163
165
  expect(REDIS.get("files2_param2_params")).to be_nil
164
166
  end
165
167
 
168
+ it 'name not found' do
169
+ param = Condition::Param.new(FILES + '/t_user.ods', 2)
170
+ expect { param.check('notexistsname', [{}]) }.to raise_error("notexistsname not found in param")
171
+ end
172
+
166
173
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: condition
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - aoyagikouhei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-22 00:00:00.000000000 Z
11
+ date: 2014-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler