sequel_validation_helpers_block 1.1.0 → 1.1.1

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: aef24a97ede9558d4e5acf778626d24d19705f4e
4
- data.tar.gz: 8b890314e88074541e572c18ad73713e57940877
3
+ metadata.gz: e62b9f5e44d0d74e6a4623425677893a205789bc
4
+ data.tar.gz: 9eeb416f21d50fad396a26c09e66ec4aae22f27d
5
5
  SHA512:
6
- metadata.gz: 8b15a04a574db9706ea5369a518901ee7f52cbb608234ce66cb79eddb472a217174f20ae462081e9bb769fe9608a220c67c7afc9fd71058b3ccdcc29705cae0d
7
- data.tar.gz: 152365214669bdd37425a03c423c89aa7b06917732b57e4961cbac95cef9df880ec8d2f5edb0629f0e2e02df5b10919b71b5d45317b36c117bcea4b052e9e826
6
+ metadata.gz: 5f599be7b062b2f793572646f5255b6057e2bdd6adea0cbb44896a02e6386ae6e322129934f96afa52ae8414aeb50529b2ac5e737b980f9cc2a2a106df8e6d3c
7
+ data.tar.gz: 6607a33b82264ac18791bd7967a3da7ecc7c2af861a74f0e2e2afff2dd3f36cf5f30186232e8ed7fea1f33ffedd561db246a76c4ed3d4968ac8af65ad75cd363
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009, 2015 Jeremy Evans
1
+ Copyright (c) 2009, 2015, 2017 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to
@@ -1,22 +1,10 @@
1
- require 'rubygems'
2
1
  require 'sequel'
3
- $: << File.join(File.dirname(__FILE__), '..', 'lib')
4
- Sequel.extension :blank
5
-
6
- if defined?(RSpec)
7
- require 'rspec/version'
8
- if RSpec::Version::STRING >= '2.11.0'
9
- RSpec.configure do |config|
10
- config.expect_with :rspec do |c|
11
- c.syntax = :should
12
- end
13
- end
14
- end
15
- end
2
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'minitest/autorun'
16
4
 
17
5
  describe "Sequel::Plugins::ValidationHelpersBlock" do
18
6
  before do
19
- @db = Sequel::Database.new
7
+ @db = Sequel.mock
20
8
  @c = Class.new(Sequel::Model(@db)) do
21
9
  def self.set_validations(&block)
22
10
  define_method(:validate, &block)
@@ -43,13 +31,13 @@ describe "Sequel::Plugins::ValidationHelpersBlock" do
43
31
  end
44
32
  end
45
33
  end
46
- @m.should_not be_valid
47
- @m.errors.should == {:name=>["is not present", "is not present"], :date=>["is invalid"], :number=>["is not present", "is not a number"]}
34
+ @m.wont_be :valid?
35
+ @m.errors.must_equal(:name=>["is not present", "is not present"], :date=>["is invalid"], :number=>["is not present", "is not a number"])
48
36
  @m.set(:name=>'1234567890-', :number=>'a', :date=>'Tuesday')
49
- @m.should_not be_valid
50
- @m.errors.should == {:name=>["is longer than 10 characters"], :date=>["is invalid"], :number=>["is not a number"]}
37
+ @m.wont_be :valid?
38
+ @m.errors.must_equal(:name=>["is longer than 10 characters"], :date=>["is invalid"], :number=>["is not a number"])
51
39
  @m.set(:name=>'1234', :number=>'10', :date=>'10/11/2009')
52
- @m.should be_valid
40
+ @m.must_be :valid?
53
41
  end
54
42
 
55
43
  specify "should accept options for validation methods" do
@@ -66,14 +54,14 @@ describe "Sequel::Plugins::ValidationHelpersBlock" do
66
54
  end
67
55
  end
68
56
  end
69
- @m.should be_valid
70
- @m.errors.should == {}
57
+ @m.must_be :valid?
58
+ @m.errors.must_equal({})
71
59
  @m.set(:name=>' ', :number=>nil)
72
- @m.should be_valid
73
- @m.errors.should == {}
60
+ @m.must_be :valid?
61
+ @m.errors.must_equal({})
74
62
  @m.set(:name=>' 12 ', :number=>'', :date=>nil)
75
- @m.should_not be_valid
76
- @m.errors.should == {:name=>["cannot be more than 10 characters"], :date=>["is invalid"], :number=>["is not a number"]}
63
+ @m.wont_be :valid?
64
+ @m.errors.must_equal(:name=>["cannot be more than 10 characters"], :date=>["is invalid"], :number=>["is not a number"])
77
65
  end
78
66
 
79
67
  specify "should support all validation_helpers methods" do
@@ -101,7 +89,7 @@ describe "Sequel::Plugins::ValidationHelpersBlock" do
101
89
  end
102
90
  ds = @db.dataset
103
91
  ds.extend(Module.new {
104
- def columns(sql)
92
+ def columns
105
93
  [:name, :date, :number]
106
94
  end
107
95
 
@@ -112,13 +100,13 @@ describe "Sequel::Plugins::ValidationHelpersBlock" do
112
100
  @c.dataset = ds
113
101
  @c.db_schema[:name] = {:type => :string}
114
102
  @m.name = ''
115
- @m.should_not be_valid
116
- @m.errors.should == {:name=>["is already taken", "is not 10 characters", "is shorter than 8 characters", "is too short or too long"], :date=>["is invalid", "is not in range or set: [\"10/11/2009\"]"], :number=>["is not present", "is not a number", "is not a number"]}
103
+ @m.wont_be :valid?
104
+ @m.errors.must_equal(:name=>["is already taken", "is not 10 characters", "is shorter than 8 characters", "is too short or too long"], :date=>["is invalid", "is not in range or set: [\"10/11/2009\"]"], :number=>["is not present", "is not a number", "is not a number"])
117
105
  @m.set(:name=>'123456789', :date=>'10/12/2009', :number=>'12')
118
- @m.should_not be_valid
119
- @m.errors.should == {:name=>["is already taken", "is not 10 characters"], :date=>["is not in range or set: [\"10/11/2009\"]"]}
106
+ @m.wont_be :valid?
107
+ @m.errors.must_equal(:name=>["is already taken", "is not 10 characters"], :date=>["is not in range or set: [\"10/11/2009\"]"])
120
108
  @m.set(:name=>'1234567890', :date=>'10/11/2009', :number=>12)
121
- @m.should be_valid
122
- @m.errors.should == {}
109
+ @m.must_be :valid?
110
+ @m.errors.must_equal({})
123
111
  end
124
112
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_validation_helpers_block
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sequel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.12.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.12.0
13
27
  description:
14
28
  email: code@jeremyevans.net
15
29
  executables: []
@@ -17,7 +31,7 @@ extensions: []
17
31
  extra_rdoc_files: []
18
32
  files:
19
33
  - LICENSE
20
- - lib/sequel_validation_helpers_block.rb
34
+ - lib/sequel/plugins/validation_helpers_block.rb
21
35
  - spec/sequel_validation_helpers_block_spec.rb
22
36
  homepage: https://github.com/jeremyevans/sequel_validation_helpers_block
23
37
  licenses:
@@ -32,7 +46,7 @@ rdoc_options:
32
46
  rules apply to a given column, at the expense of increased verbosity'
33
47
  - "--main"
34
48
  - Sequel::Plugins::ValidationHelpersBlock
35
- - lib/sequel_validation_helpers_block.rb
49
+ - lib/sequel/plugins/validation_helpers_block.rb
36
50
  - LICENSE
37
51
  require_paths:
38
52
  - lib
@@ -48,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
62
  version: '0'
49
63
  requirements: []
50
64
  rubyforge_project:
51
- rubygems_version: 2.4.5
65
+ rubygems_version: 2.6.11
52
66
  signing_key:
53
67
  specification_version: 4
54
68
  summary: Allows easy determination of which validation rules apply to a given column,