ohm 0.1.0.rc5 → 0.1.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -13
- data/lib/ohm.rb +54 -97
- data/lib/ohm/key.rb +4 -31
- data/lib/ohm/version.rb +1 -1
- data/test/1.8.6_test.rb +18 -18
- data/test/associations_test.rb +100 -0
- data/test/connection_test.rb +33 -21
- data/test/errors_test.rb +88 -88
- data/test/hash_key_test.rb +16 -23
- data/test/helper.rb +25 -0
- data/test/indices_test.rb +177 -183
- data/test/json_test.rb +67 -0
- data/test/model_test.rb +675 -868
- data/test/mutex_test.rb +65 -70
- data/test/pattern_test.rb +8 -6
- data/test/upgrade_script_test.rb +41 -47
- data/test/validations_test.rb +180 -164
- data/test/wrapper_test.rb +7 -5
- metadata +26 -10
- data/test/all_tests.rb +0 -2
- data/test/test_helper.rb +0 -53
data/test/wrapper_test.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require File.expand_path("./helper", File.dirname(__FILE__))
|
4
|
+
|
5
|
+
prepare.clear
|
2
6
|
|
3
7
|
$missing_constants = []
|
4
8
|
|
@@ -13,8 +17,6 @@ class Foo < Ohm::Model
|
|
13
17
|
set :bars, Bar
|
14
18
|
end
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
assert_equal [:Bar], $missing_constants
|
19
|
-
end
|
20
|
+
test "calls other const_missing hooks" do
|
21
|
+
assert [:Bar] == $missing_constants
|
20
22
|
end
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.1.0.
|
9
|
+
- rc6
|
10
|
+
version: 0.1.0.rc6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michel Martens
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-09-23 00:00:00 -03:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
26
|
none: false
|
27
27
|
requirements:
|
28
|
-
- -
|
28
|
+
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
segments:
|
31
31
|
- 2
|
@@ -35,9 +35,24 @@ dependencies:
|
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
38
|
+
name: nest
|
39
39
|
prerelease: false
|
40
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 0
|
48
|
+
- 7
|
49
|
+
version: 0.0.7
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: contest
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
56
|
none: false
|
42
57
|
requirements:
|
43
58
|
- - ~>
|
@@ -47,11 +62,11 @@ dependencies:
|
|
47
62
|
- 1
|
48
63
|
version: "0.1"
|
49
64
|
type: :development
|
50
|
-
version_requirements: *
|
65
|
+
version_requirements: *id003
|
51
66
|
- !ruby/object:Gem::Dependency
|
52
67
|
name: batch
|
53
68
|
prerelease: false
|
54
|
-
requirement: &
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
55
70
|
none: false
|
56
71
|
requirements:
|
57
72
|
- - ~>
|
@@ -62,7 +77,7 @@ dependencies:
|
|
62
77
|
- 1
|
63
78
|
version: 0.0.1
|
64
79
|
type: :development
|
65
|
-
version_requirements: *
|
80
|
+
version_requirements: *id004
|
66
81
|
description: Ohm is a library that allows to store an object in Redis, a persistent key-value database. It includes an extensible list of validations and has very good performance.
|
67
82
|
email:
|
68
83
|
- michel@soveran.com
|
@@ -85,15 +100,16 @@ files:
|
|
85
100
|
- LICENSE
|
86
101
|
- Rakefile
|
87
102
|
- test/1.8.6_test.rb
|
88
|
-
- test/
|
103
|
+
- test/associations_test.rb
|
89
104
|
- test/connection_test.rb
|
90
105
|
- test/errors_test.rb
|
91
106
|
- test/hash_key_test.rb
|
107
|
+
- test/helper.rb
|
92
108
|
- test/indices_test.rb
|
109
|
+
- test/json_test.rb
|
93
110
|
- test/model_test.rb
|
94
111
|
- test/mutex_test.rb
|
95
112
|
- test/pattern_test.rb
|
96
|
-
- test/test_helper.rb
|
97
113
|
- test/upgrade_script_test.rb
|
98
114
|
- test/validations_test.rb
|
99
115
|
- test/wrapper_test.rb
|
data/test/all_tests.rb
DELETED
data/test/test_helper.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
2
|
-
|
3
|
-
begin
|
4
|
-
require "ruby-debug"
|
5
|
-
rescue LoadError
|
6
|
-
end
|
7
|
-
|
8
|
-
require "contest"
|
9
|
-
|
10
|
-
def silence_warnings
|
11
|
-
original_verbose, $VERBOSE = $VERBOSE, nil
|
12
|
-
yield
|
13
|
-
ensure
|
14
|
-
$VERBOSE = original_verbose
|
15
|
-
end
|
16
|
-
|
17
|
-
$VERBOSE = true
|
18
|
-
|
19
|
-
class Logger
|
20
|
-
def self.current
|
21
|
-
Thread.current[:logger] ||= new
|
22
|
-
end
|
23
|
-
|
24
|
-
def initialize
|
25
|
-
clear
|
26
|
-
end
|
27
|
-
|
28
|
-
def clear
|
29
|
-
@lines = []
|
30
|
-
end
|
31
|
-
|
32
|
-
def debug(message)
|
33
|
-
@lines << message.to_s
|
34
|
-
end
|
35
|
-
|
36
|
-
def debug?; true; end
|
37
|
-
alias info debug
|
38
|
-
alias warn debug
|
39
|
-
alias error debug
|
40
|
-
|
41
|
-
def commands
|
42
|
-
@lines.map { |line| line[/Redis >> ([A-Z].+?)$/, 1] }.compact
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
require "ohm"
|
47
|
-
|
48
|
-
class Test::Unit::TestCase
|
49
|
-
setup do
|
50
|
-
Ohm.redis = Redis.connect(:logger => Logger.current)
|
51
|
-
Ohm.flush
|
52
|
-
end
|
53
|
-
end
|