activegroonga 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/README.textile +55 -0
  2. data/Rakefile +45 -165
  3. data/{license/LGPL → doc/text/lgpl.txt} +0 -0
  4. data/doc/text/news.textile +60 -0
  5. data/doc/text/tutorial.textile +3 -0
  6. data/lib/active_groonga/base.rb +50 -2
  7. data/lib/active_groonga/railtie.rb +6 -5
  8. data/lib/active_groonga/railties/groonga.rake +8 -4
  9. data/lib/active_groonga/result_set.rb +133 -8
  10. data/lib/active_groonga/version.rb +1 -1
  11. data/test/active-groonga-test-utils.rb +6 -0
  12. data/test/run-test.rb +11 -24
  13. data/test/test-base.rb +10 -4
  14. data/test/test-result-set.rb +121 -9
  15. metadata +90 -138
  16. data/AUTHORS +0 -1
  17. data/NEWS.ja.rdoc +0 -46
  18. data/NEWS.rdoc +0 -46
  19. data/README.ja.rdoc +0 -52
  20. data/README.rdoc +0 -52
  21. data/test-unit-notify/Rakefile +0 -47
  22. data/test-unit-notify/lib/test/unit/notify.rb +0 -104
  23. data/test-unit/COPYING +0 -56
  24. data/test-unit/GPL +0 -340
  25. data/test-unit/PSFL +0 -271
  26. data/test-unit/Rakefile +0 -53
  27. data/test-unit/TODO +0 -5
  28. data/test-unit/bin/testrb +0 -5
  29. data/test-unit/html/bar.svg +0 -153
  30. data/test-unit/html/developer.svg +0 -469
  31. data/test-unit/html/favicon.ico +0 -0
  32. data/test-unit/html/favicon.svg +0 -82
  33. data/test-unit/html/heading-mark.svg +0 -393
  34. data/test-unit/html/index.html +0 -247
  35. data/test-unit/html/index.html.ja +0 -270
  36. data/test-unit/html/install.svg +0 -636
  37. data/test-unit/html/logo.svg +0 -483
  38. data/test-unit/html/test-unit.css +0 -339
  39. data/test-unit/html/tutorial.svg +0 -559
  40. data/test-unit/lib/test/unit.rb +0 -328
  41. data/test-unit/lib/test/unit/assertionfailederror.rb +0 -25
  42. data/test-unit/lib/test/unit/assertions.rb +0 -1334
  43. data/test-unit/lib/test/unit/attribute.rb +0 -125
  44. data/test-unit/lib/test/unit/autorunner.rb +0 -363
  45. data/test-unit/lib/test/unit/collector.rb +0 -36
  46. data/test-unit/lib/test/unit/collector/descendant.rb +0 -23
  47. data/test-unit/lib/test/unit/collector/dir.rb +0 -108
  48. data/test-unit/lib/test/unit/collector/load.rb +0 -144
  49. data/test-unit/lib/test/unit/collector/objectspace.rb +0 -34
  50. data/test-unit/lib/test/unit/color-scheme.rb +0 -106
  51. data/test-unit/lib/test/unit/color.rb +0 -96
  52. data/test-unit/lib/test/unit/diff.rb +0 -740
  53. data/test-unit/lib/test/unit/error.rb +0 -130
  54. data/test-unit/lib/test/unit/exceptionhandler.rb +0 -39
  55. data/test-unit/lib/test/unit/failure.rb +0 -136
  56. data/test-unit/lib/test/unit/fixture.rb +0 -176
  57. data/test-unit/lib/test/unit/notification.rb +0 -129
  58. data/test-unit/lib/test/unit/omission.rb +0 -191
  59. data/test-unit/lib/test/unit/pending.rb +0 -150
  60. data/test-unit/lib/test/unit/priority.rb +0 -180
  61. data/test-unit/lib/test/unit/runner/console.rb +0 -52
  62. data/test-unit/lib/test/unit/runner/emacs.rb +0 -8
  63. data/test-unit/lib/test/unit/runner/tap.rb +0 -8
  64. data/test-unit/lib/test/unit/testcase.rb +0 -483
  65. data/test-unit/lib/test/unit/testresult.rb +0 -121
  66. data/test-unit/lib/test/unit/testsuite.rb +0 -110
  67. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +0 -14
  68. data/test-unit/lib/test/unit/ui/console/testrunner.rb +0 -430
  69. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +0 -63
  70. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +0 -82
  71. data/test-unit/lib/test/unit/ui/testrunner.rb +0 -53
  72. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +0 -77
  73. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +0 -41
  74. data/test-unit/lib/test/unit/util/backtracefilter.rb +0 -42
  75. data/test-unit/lib/test/unit/util/method-owner-finder.rb +0 -28
  76. data/test-unit/lib/test/unit/util/observable.rb +0 -90
  77. data/test-unit/lib/test/unit/util/output.rb +0 -31
  78. data/test-unit/lib/test/unit/util/procwrapper.rb +0 -48
  79. data/test-unit/lib/test/unit/version.rb +0 -7
  80. data/test-unit/sample/adder.rb +0 -13
  81. data/test-unit/sample/subtracter.rb +0 -12
  82. data/test-unit/sample/test_adder.rb +0 -20
  83. data/test-unit/sample/test_subtracter.rb +0 -20
  84. data/test-unit/sample/test_user.rb +0 -23
  85. data/test-unit/test/collector/test-descendant.rb +0 -133
  86. data/test-unit/test/collector/test-load.rb +0 -442
  87. data/test-unit/test/collector/test_dir.rb +0 -406
  88. data/test-unit/test/collector/test_objectspace.rb +0 -100
  89. data/test-unit/test/run-test.rb +0 -15
  90. data/test-unit/test/test-attribute.rb +0 -86
  91. data/test-unit/test/test-color-scheme.rb +0 -69
  92. data/test-unit/test/test-color.rb +0 -47
  93. data/test-unit/test/test-diff.rb +0 -518
  94. data/test-unit/test/test-emacs-runner.rb +0 -60
  95. data/test-unit/test/test-fixture.rb +0 -287
  96. data/test-unit/test/test-notification.rb +0 -33
  97. data/test-unit/test/test-omission.rb +0 -81
  98. data/test-unit/test/test-pending.rb +0 -70
  99. data/test-unit/test/test-priority.rb +0 -119
  100. data/test-unit/test/test-testcase.rb +0 -544
  101. data/test-unit/test/test_assertions.rb +0 -1197
  102. data/test-unit/test/test_error.rb +0 -26
  103. data/test-unit/test/test_failure.rb +0 -33
  104. data/test-unit/test/test_testresult.rb +0 -113
  105. data/test-unit/test/test_testsuite.rb +0 -129
  106. data/test-unit/test/testunit-test-util.rb +0 -14
  107. data/test-unit/test/ui/test_tap.rb +0 -33
  108. data/test-unit/test/ui/test_testrunmediator.rb +0 -20
  109. data/test-unit/test/util/test-method-owner-finder.rb +0 -38
  110. data/test-unit/test/util/test-output.rb +0 -11
  111. data/test-unit/test/util/test_backtracefilter.rb +0 -41
  112. data/test-unit/test/util/test_observable.rb +0 -102
  113. data/test-unit/test/util/test_procwrapper.rb +0 -36
@@ -1,102 +0,0 @@
1
- # Author:: Nathaniel Talbott.
2
- # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
3
- # License:: Ruby license.
4
-
5
- require 'test/unit/util/observable'
6
-
7
- module Test
8
- module Unit
9
- module Util
10
- class TC_Observable < TestCase
11
-
12
- class TF_Observable
13
- include Observable
14
- end
15
-
16
- def setup
17
- @observable = TF_Observable.new
18
- end
19
-
20
- def test_simple_observation
21
- assert_raises(ArgumentError, "add_listener should throw an exception if no callback is supplied") do
22
- @observable.add_listener(:property, "a")
23
- end
24
-
25
- heard = false
26
- callback = proc { heard = true }
27
- assert_equal("a", @observable.add_listener(:property, "a", &callback), "add_listener should return the listener that was added")
28
-
29
- count = 0
30
- @observable.instance_eval do
31
- count = notify_listeners(:property)
32
- end
33
- assert_equal(1, count, "notify_listeners should have returned the number of listeners that were notified")
34
- assert(heard, "Should have heard the property changed")
35
-
36
- heard = false
37
- assert_equal(callback, @observable.remove_listener(:property, "a"), "remove_listener should return the callback")
38
-
39
- count = 1
40
- @observable.instance_eval do
41
- count = notify_listeners(:property)
42
- end
43
- assert_equal(0, count, "notify_listeners should have returned the number of listeners that were notified")
44
- assert(!heard, "Should not have heard the property change")
45
- end
46
-
47
- def test_value_observation
48
- value = nil
49
- @observable.add_listener(:property, "a") do |passed_value|
50
- value = passed_value
51
- end
52
- count = 0
53
- @observable.instance_eval do
54
- count = notify_listeners(:property, "stuff")
55
- end
56
- assert_equal(1, count, "Should have update the correct number of listeners")
57
- assert_equal("stuff", value, "Should have received the value as an argument to the listener")
58
- end
59
-
60
- def test_multiple_value_observation
61
- values = []
62
- @observable.add_listener(:property, "a") do |first_value, second_value|
63
- values = [first_value, second_value]
64
- end
65
- count = 0
66
- @observable.instance_eval do
67
- count = notify_listeners(:property, "stuff", "more stuff")
68
- end
69
- assert_equal(1, count, "Should have update the correct number of listeners")
70
- assert_equal(["stuff", "more stuff"], values, "Should have received the value as an argument to the listener")
71
- end
72
-
73
- def test_add_remove_with_default_listener
74
- assert_raises(ArgumentError, "add_listener should throw an exception if no callback is supplied") do
75
- @observable.add_listener(:property)
76
- end
77
-
78
- heard = false
79
- callback = proc { heard = true }
80
- assert_equal(callback, @observable.add_listener(:property, &callback), "add_listener should return the listener that was added")
81
-
82
- count = 0
83
- @observable.instance_eval do
84
- count = notify_listeners(:property)
85
- end
86
- assert_equal(1, count, "notify_listeners should have returned the number of listeners that were notified")
87
- assert(heard, "Should have heard the property changed")
88
-
89
- heard = false
90
- assert_equal(callback, @observable.remove_listener(:property, callback), "remove_listener should return the callback")
91
-
92
- count = 1
93
- @observable.instance_eval do
94
- count = notify_listeners(:property)
95
- end
96
- assert_equal(0, count, "notify_listeners should have returned the number of listeners that were notified")
97
- assert(!heard, "Should not have heard the property change")
98
- end
99
- end
100
- end
101
- end
102
- end
@@ -1,36 +0,0 @@
1
- # Author:: Nathaniel Talbott.
2
- # Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
3
- # License:: Ruby license.
4
-
5
- require 'test/unit'
6
- require 'test/unit/util/procwrapper'
7
-
8
- module Test
9
- module Unit
10
- module Util
11
- class TC_ProcWrapper < TestCase
12
- def munge_proc(&a_proc)
13
- return a_proc
14
- end
15
- def setup
16
- @original = proc {}
17
- @munged = munge_proc(&@original)
18
- @wrapped_original = ProcWrapper.new(@original)
19
- @wrapped_munged = ProcWrapper.new(@munged)
20
- end
21
- def test_wrapping
22
- assert_same(@original, @wrapped_original.to_proc, "The wrapper should return what was wrapped")
23
- end
24
- def test_hashing
25
-
26
- assert_equal(@wrapped_original.hash, @wrapped_munged.hash, "The original and munged should have the same hash when wrapped")
27
- assert_equal(@wrapped_original, @wrapped_munged, "The wrappers should be equivalent")
28
-
29
- a_hash = {@wrapped_original => @original}
30
- assert(a_hash[@wrapped_original], "Should be able to access the wrapper in the hash")
31
- assert_equal(a_hash[@wrapped_original], @original, "Should be able to access the wrapper in the hash")
32
- end
33
- end
34
- end
35
- end
36
- end