the_force 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/the_force/thread_pool.rb +1 -1
- data/test/unit/test_object_support.rb +23 -4
- metadata +17 -5
data/Rakefile
CHANGED
@@ -2,7 +2,14 @@ require 'test/unit'
|
|
2
2
|
begin
|
3
3
|
require File.join(File.dirname(__FILE__), '../../lib/the_force/object_support.rb')
|
4
4
|
rescue LoadError
|
5
|
-
require File.expand_path('
|
5
|
+
require File.expand_path('../../lib/the_force/object_support.rb', __FILE__)
|
6
|
+
end
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'active_support'
|
10
|
+
rescue LoadError
|
11
|
+
puts "There are some special cases under Rails' active_support that we must test, please install the rails gem"
|
12
|
+
raise
|
6
13
|
end
|
7
14
|
|
8
15
|
class TestObjectSupport < Test::Unit::TestCase
|
@@ -10,7 +17,6 @@ class TestObjectSupport < Test::Unit::TestCase
|
|
10
17
|
assert_equal "a", "a".if.length
|
11
18
|
assert_equal nil, "a".unless.length
|
12
19
|
end
|
13
|
-
|
14
20
|
|
15
21
|
def test_if_as_blank_slate_when_it_returns_true
|
16
22
|
assert_equal "", "".if.empty?
|
@@ -18,8 +24,7 @@ class TestObjectSupport < Test::Unit::TestCase
|
|
18
24
|
def test_unless_as_blank_slate_when_it_returns_true
|
19
25
|
assert_equal nil, "".unless.empty?
|
20
26
|
end
|
21
|
-
|
22
|
-
|
27
|
+
|
23
28
|
def test_if_as_blank_slate_when_it_returns_false
|
24
29
|
assert_equal nil, "a".if.empty?
|
25
30
|
end
|
@@ -27,6 +32,20 @@ class TestObjectSupport < Test::Unit::TestCase
|
|
27
32
|
assert_equal "a", "a".unless.nil?
|
28
33
|
end
|
29
34
|
|
35
|
+
def test_if_as_blank_slate_when_it_returns_true_with_active_support_blank?
|
36
|
+
assert_equal " ", " ".if.blank?
|
37
|
+
end
|
38
|
+
def test_unless_as_blank_slate_when_it_returns_true_with_active_support_blank?
|
39
|
+
assert_equal nil, " ".unless.blank?
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_if_as_blank_slate_when_it_returns_false_with_active_support_blank?
|
43
|
+
assert_equal nil, "a".if.blank?
|
44
|
+
end
|
45
|
+
def test_unless_as_blank_slate_when_it_returns_false_with_active_support_blank?
|
46
|
+
puts "here: " + "a".unless.blank?
|
47
|
+
assert_equal "a", "a".unless.blank?
|
48
|
+
end
|
30
49
|
|
31
50
|
def test_if_with_block_when_it_returns_true
|
32
51
|
assert_equal "", "".if {|x| x.empty? }
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_force
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 25
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Ryan Ziegler
|
@@ -9,7 +15,7 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-05-20 00:00:00 -04:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
@@ -44,21 +50,27 @@ rdoc_options:
|
|
44
50
|
require_paths:
|
45
51
|
- lib
|
46
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
47
54
|
requirements:
|
48
55
|
- - ">="
|
49
56
|
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
50
60
|
version: "0"
|
51
|
-
version:
|
52
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
53
63
|
requirements:
|
54
64
|
- - ">="
|
55
65
|
- !ruby/object:Gem::Version
|
66
|
+
hash: 3
|
67
|
+
segments:
|
68
|
+
- 0
|
56
69
|
version: "0"
|
57
|
-
version:
|
58
70
|
requirements: []
|
59
71
|
|
60
72
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.3.
|
73
|
+
rubygems_version: 1.3.7
|
62
74
|
signing_key:
|
63
75
|
specification_version: 3
|
64
76
|
summary: Common code for Symbolforce
|