do_riak 0.10.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. data/CHANGELOG +2 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +20 -0
  4. data/README.textile +23 -0
  5. data/TODO.txt +4 -0
  6. data/deps.rip +8 -0
  7. data/do_riak.gemspec +40 -0
  8. data/do_riak.pre.gemspec +8 -0
  9. data/gems/cache/bacon-1.1.0.gem +0 -0
  10. data/gems/cache/code-cleaner-0.8.1.gem +0 -0
  11. data/gems/cache/nake-0.0.8.gem +0 -0
  12. data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
  13. data/gems/environment.rb +107 -0
  14. data/gems/gems/bacon-1.1.0/COPYING +18 -0
  15. data/gems/gems/bacon-1.1.0/ChangeLog +220 -0
  16. data/gems/gems/bacon-1.1.0/RDOX +69 -0
  17. data/gems/gems/bacon-1.1.0/README +290 -0
  18. data/gems/gems/bacon-1.1.0/Rakefile +138 -0
  19. data/gems/gems/bacon-1.1.0/bin/bacon +117 -0
  20. data/gems/gems/bacon-1.1.0/lib/autotest/bacon.rb +36 -0
  21. data/gems/gems/bacon-1.1.0/lib/autotest/bacon_rspec.rb +2 -0
  22. data/gems/gems/bacon-1.1.0/lib/autotest/discover.rb +9 -0
  23. data/gems/gems/bacon-1.1.0/lib/bacon.rb +354 -0
  24. data/gems/gems/bacon-1.1.0/test/spec_bacon.rb +374 -0
  25. data/gems/gems/bacon-1.1.0/test/spec_should.rb +32 -0
  26. data/gems/gems/code-cleaner-0.8.1/LICENSE +20 -0
  27. data/gems/gems/code-cleaner-0.8.1/README.textile +87 -0
  28. data/gems/gems/code-cleaner-0.8.1/TODO.txt +1 -0
  29. data/gems/gems/code-cleaner-0.8.1/bin/code-cleaner +143 -0
  30. data/gems/gems/code-cleaner-0.8.1/code-cleaner-0.8.gem +0 -0
  31. data/gems/gems/code-cleaner-0.8.1/code-cleaner.gemspec +25 -0
  32. data/gems/gems/code-cleaner-0.8.1/support/pre-commit.erb +70 -0
  33. data/gems/gems/code-cleaner-0.8.1/tasks.rb +13 -0
  34. data/gems/gems/code-cleaner-0.8.1/tasks/code-cleaner.nake +49 -0
  35. data/gems/gems/code-cleaner-0.8.1/tasks/code-cleaner.rake +22 -0
  36. data/gems/gems/code-cleaner-0.8.1/tasks/code-cleaner.thor +35 -0
  37. data/gems/gems/nake-0.0.8/CHANGELOG +48 -0
  38. data/gems/gems/nake-0.0.8/LICENSE +20 -0
  39. data/gems/gems/nake-0.0.8/README.textile +39 -0
  40. data/gems/gems/nake-0.0.8/TODO.txt +23 -0
  41. data/gems/gems/nake-0.0.8/bin/nake +66 -0
  42. data/gems/gems/nake-0.0.8/bin/nrake +4 -0
  43. data/gems/gems/nake-0.0.8/bin/rake2nake +1 -0
  44. data/gems/gems/nake-0.0.8/bin/snake +41 -0
  45. data/gems/gems/nake-0.0.8/bm/Rakefile +28 -0
  46. data/gems/gems/nake-0.0.8/bm/bms.rb +56 -0
  47. data/gems/gems/nake-0.0.8/bm/output.txt +5 -0
  48. data/gems/gems/nake-0.0.8/bm/tasks.rb +21 -0
  49. data/gems/gems/nake-0.0.8/bm/tmp/test.c +6 -0
  50. data/gems/gems/nake-0.0.8/bm/tmp/www/index.html +1 -0
  51. data/gems/gems/nake-0.0.8/deps.rb +5 -0
  52. data/gems/gems/nake-0.0.8/deps.rip +5 -0
  53. data/gems/gems/nake-0.0.8/examples/arguments.rb +38 -0
  54. data/gems/gems/nake-0.0.8/examples/basic.rb +5 -0
  55. data/gems/gems/nake-0.0.8/examples/boot.rb +18 -0
  56. data/gems/gems/nake-0.0.8/examples/complex.rb +9 -0
  57. data/gems/gems/nake-0.0.8/examples/configuration.rb +15 -0
  58. data/gems/gems/nake-0.0.8/examples/default.rb +10 -0
  59. data/gems/gems/nake-0.0.8/examples/default_proc.rb +11 -0
  60. data/gems/gems/nake-0.0.8/examples/dependencies.rb +10 -0
  61. data/gems/gems/nake-0.0.8/examples/description.rb +33 -0
  62. data/gems/gems/nake-0.0.8/examples/file.rb +22 -0
  63. data/gems/gems/nake-0.0.8/examples/helpers.rb +3 -0
  64. data/gems/gems/nake-0.0.8/examples/invoking.rb +14 -0
  65. data/gems/gems/nake-0.0.8/examples/rules.rb +0 -0
  66. data/gems/gems/nake-0.0.8/examples/script.rb +20 -0
  67. data/gems/gems/nake-0.0.8/examples/task_arguments.rb +27 -0
  68. data/gems/gems/nake-0.0.8/features/arguments.feature +22 -0
  69. data/gems/gems/nake-0.0.8/features/basic.feature +6 -0
  70. data/gems/gems/nake-0.0.8/features/boot.feature +5 -0
  71. data/gems/gems/nake-0.0.8/features/builtin_arguments.feature +14 -0
  72. data/gems/gems/nake-0.0.8/features/complex.feature +6 -0
  73. data/gems/gems/nake-0.0.8/features/configuration.feature +10 -0
  74. data/gems/gems/nake-0.0.8/features/default.feature +10 -0
  75. data/gems/gems/nake-0.0.8/features/default_proc.feature +6 -0
  76. data/gems/gems/nake-0.0.8/features/dependencies.feature +16 -0
  77. data/gems/gems/nake-0.0.8/features/description.feature +0 -0
  78. data/gems/gems/nake-0.0.8/features/env.rb +11 -0
  79. data/gems/gems/nake-0.0.8/features/executable.feature +29 -0
  80. data/gems/gems/nake-0.0.8/features/file.feature +23 -0
  81. data/gems/gems/nake-0.0.8/features/helpers.feature +6 -0
  82. data/gems/gems/nake-0.0.8/features/invoking.feature +14 -0
  83. data/gems/gems/nake-0.0.8/features/rules.feature +0 -0
  84. data/gems/gems/nake-0.0.8/features/script.feature +10 -0
  85. data/gems/gems/nake-0.0.8/features/steps.rb +39 -0
  86. data/gems/gems/nake-0.0.8/features/task_arguments.feature +10 -0
  87. data/gems/gems/nake-0.0.8/lib/nake.rb +103 -0
  88. data/gems/gems/nake-0.0.8/lib/nake/abstract_task.rb +175 -0
  89. data/gems/gems/nake-0.0.8/lib/nake/args.rb +65 -0
  90. data/gems/gems/nake-0.0.8/lib/nake/argv.rb +47 -0
  91. data/gems/gems/nake-0.0.8/lib/nake/colors.rb +22 -0
  92. data/gems/gems/nake-0.0.8/lib/nake/dsl.rb +70 -0
  93. data/gems/gems/nake-0.0.8/lib/nake/file_task.rb +62 -0
  94. data/gems/gems/nake-0.0.8/lib/nake/helpers.rb +65 -0
  95. data/gems/gems/nake-0.0.8/lib/nake/rake.rb +38 -0
  96. data/gems/gems/nake-0.0.8/lib/nake/rule.rb +35 -0
  97. data/gems/gems/nake-0.0.8/lib/nake/struct_hash.rb +22 -0
  98. data/gems/gems/nake-0.0.8/lib/nake/task.rb +6 -0
  99. data/gems/gems/nake-0.0.8/lib/nake/tasks/bundle.rb +30 -0
  100. data/gems/gems/nake-0.0.8/lib/nake/tasks/clean.rb +12 -0
  101. data/gems/gems/nake-0.0.8/lib/nake/tasks/gem.rb +29 -0
  102. data/gems/gems/nake-0.0.8/lib/nake/tasks/release.rb +43 -0
  103. data/gems/gems/nake-0.0.8/lib/nake/tasks/rip.rb +33 -0
  104. data/gems/gems/nake-0.0.8/lib/nake/tasks/spec.rb +20 -0
  105. data/gems/gems/nake-0.0.8/lib/nake/template.rb +51 -0
  106. data/gems/gems/nake-0.0.8/nake-0.0.8.pre.gem +0 -0
  107. data/gems/gems/nake-0.0.8/nake.gemspec +42 -0
  108. data/gems/gems/nake-0.0.8/nake.pre.gemspec +8 -0
  109. data/gems/gems/nake-0.0.8/spec/nake/abstract_task_spec.rb +0 -0
  110. data/gems/gems/nake-0.0.8/spec/nake/args_spec.rb +0 -0
  111. data/gems/gems/nake-0.0.8/spec/nake/argv_spec.rb +51 -0
  112. data/gems/gems/nake-0.0.8/spec/nake/colors_spec.rb +0 -0
  113. data/gems/gems/nake-0.0.8/spec/nake/dsl_spec.rb +35 -0
  114. data/gems/gems/nake-0.0.8/spec/nake/file_task_spec.rb +0 -0
  115. data/gems/gems/nake-0.0.8/spec/nake/helpers_spec.rb +14 -0
  116. data/gems/gems/nake-0.0.8/spec/nake/rake_spec.rb +0 -0
  117. data/gems/gems/nake-0.0.8/spec/nake/rule_spec.rb +72 -0
  118. data/gems/gems/nake-0.0.8/spec/nake/struct_hash_spec.rb +0 -0
  119. data/gems/gems/nake-0.0.8/spec/nake/task_spec.rb +72 -0
  120. data/gems/gems/nake-0.0.8/spec/nake/tasks/bundle_spec.rb +28 -0
  121. data/gems/gems/nake-0.0.8/spec/nake/tasks/clean_spec.rb +0 -0
  122. data/gems/gems/nake-0.0.8/spec/nake/tasks/gem_spec.rb +0 -0
  123. data/gems/gems/nake-0.0.8/spec/nake/tasks/release_spec.rb +0 -0
  124. data/gems/gems/nake-0.0.8/spec/nake/tasks/rip_spec.rb +0 -0
  125. data/gems/gems/nake-0.0.8/spec/nake/tasks/spec_spec.rb +0 -0
  126. data/gems/gems/nake-0.0.8/spec/nake/tasks_spec.rb +48 -0
  127. data/gems/gems/nake-0.0.8/spec/nake/template_spec.rb +84 -0
  128. data/gems/gems/nake-0.0.8/spec/nake_spec.rb +9 -0
  129. data/gems/gems/nake-0.0.8/spec/spec.opts +5 -0
  130. data/gems/gems/nake-0.0.8/spec/spec_helper.rb +29 -0
  131. data/gems/gems/nake-0.0.8/spec/stubs/database.yml.erb +9 -0
  132. data/gems/gems/nake-0.0.8/spec/stubs/database.yml.tt +9 -0
  133. data/gems/gems/nake-0.0.8/tasks.rb +42 -0
  134. data/gems/gems/term-ansicolor-1.0.4/CHANGES +22 -0
  135. data/gems/gems/term-ansicolor-1.0.4/COPYING +340 -0
  136. data/gems/gems/term-ansicolor-1.0.4/README +31 -0
  137. data/gems/gems/term-ansicolor-1.0.4/Rakefile +86 -0
  138. data/gems/gems/term-ansicolor-1.0.4/VERSION +1 -0
  139. data/gems/gems/term-ansicolor-1.0.4/doc-main.txt +119 -0
  140. data/gems/gems/term-ansicolor-1.0.4/examples/cdiff.rb +19 -0
  141. data/gems/gems/term-ansicolor-1.0.4/examples/example.rb +89 -0
  142. data/gems/gems/term-ansicolor-1.0.4/install.rb +15 -0
  143. data/gems/gems/term-ansicolor-1.0.4/lib/term/ansicolor.rb +102 -0
  144. data/gems/gems/term-ansicolor-1.0.4/lib/term/ansicolor/version.rb +10 -0
  145. data/gems/gems/term-ansicolor-1.0.4/term-ansicolor.gemspec +20 -0
  146. data/gems/specifications/bacon-1.1.0.gemspec +30 -0
  147. data/gems/specifications/code-cleaner-0.8.1.gemspec +31 -0
  148. data/gems/specifications/nake-0.0.8.gemspec +35 -0
  149. data/gems/specifications/term-ansicolor-1.0.4.gemspec +30 -0
  150. data/lib/do_riak.rb +10 -0
  151. data/lib/do_riak/errors.rb +11 -0
  152. data/lib/do_riak/transaction.rb +24 -0
  153. data/lib/do_riak/version.rb +7 -0
  154. data/script/bacon +3 -0
  155. data/script/code-cleaner +3 -0
  156. data/script/nake +3 -0
  157. data/spec/command_spec.rb +8 -0
  158. data/spec/connection_spec.rb +17 -0
  159. data/spec/reader_spec.rb +8 -0
  160. data/spec/result_spec.rb +12 -0
  161. data/spec/spec_helper.rb +19 -0
  162. data/spec/typecast/array_spec.rb +8 -0
  163. data/spec/typecast/bigdecimal_spec.rb +8 -0
  164. data/spec/typecast/boolean_spec.rb +8 -0
  165. data/spec/typecast/byte_array_spec.rb +8 -0
  166. data/spec/typecast/class_spec.rb +8 -0
  167. data/spec/typecast/date_spec.rb +8 -0
  168. data/spec/typecast/datetime_spec.rb +8 -0
  169. data/spec/typecast/float_spec.rb +12 -0
  170. data/spec/typecast/integer_spec.rb +8 -0
  171. data/spec/typecast/nil_spec.rb +16 -0
  172. data/spec/typecast/other_spec.rb +8 -0
  173. data/spec/typecast/range_spec.rb +8 -0
  174. data/spec/typecast/string_spec.rb +8 -0
  175. data/spec/typecast/time_spec.rb +8 -0
  176. data/tasks.rb +37 -0
  177. metadata +238 -0
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env gem build
2
+ # encoding: utf-8
3
+
4
+ # You might think this is a terrible mess and guess what, you're
5
+ # right mate! However say thanks to authors of RubyGems, not me.
6
+ eval(File.read("nake.gemspec")).tap do |specification|
7
+ specification.version = "#{specification.version}.pre"
8
+ end
File without changes
@@ -0,0 +1,51 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/argv"
5
+
6
+ describe Nake::ArgvParsingMixin do
7
+ def parse(*args)
8
+ args.extend(Nake::ArgvParsingMixin)
9
+ args.extract!
10
+ end
11
+
12
+ describe "#parse!" do
13
+ it "should returns Hash" do
14
+ parse.should be_kind_of(Hash)
15
+ end
16
+
17
+ it "should parse --git-repository to {git_repository: true}" do
18
+ options = parse("--git-repository")
19
+ options[:git_repository].should be_true
20
+ end
21
+
22
+ it "should parse --no-github to {github: false}" do
23
+ options = parse("--no-github")
24
+ options[:github].should be_false
25
+ end
26
+
27
+ it "should parse --controller=posts to {controller: 'posts'}" do
28
+ options = parse("--controller=posts")
29
+ options[:controller].should eql("posts")
30
+ end
31
+
32
+ it "should parse --models=post,comment to {models: ['post', 'comment']}" do
33
+ options = parse("--models=post,comment")
34
+ options[:models].should eql(["post", "comment"])
35
+ end
36
+
37
+ it "should remove argument from ARGV if the argument was successfuly mapped to an option" do
38
+ args = ["--user=botanicus"]
39
+ args.extend(Nake::ArgvParsingMixin)
40
+ args.extract!
41
+ args.should be_empty
42
+ end
43
+
44
+ it "should not remove argument from ARGV if the argument wasn't mapped to an option" do
45
+ args = ["one", "two", "three"]
46
+ args.extend(Nake::ArgvParsingMixin)
47
+ args.extract!
48
+ args.length.should eql(3)
49
+ end
50
+ end
51
+ end
File without changes
@@ -0,0 +1,35 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/dsl"
5
+
6
+ describe "Object#task" do
7
+ before(:each) do
8
+ Nake::Task.tasks.clear
9
+ end
10
+
11
+ it "should take name as a first argument" do
12
+ task(:name).name.should eql(:name)
13
+ end
14
+
15
+ it "should optinally take other arguments as a dependencies" do
16
+ task(:release, :build, :tag).dependencies.should eql([:build, :tag])
17
+ end
18
+
19
+ it "should optinally take a block as a task definition" do
20
+ task = task(:release) { "released!" }
21
+ task.should have(1).blocks
22
+ end
23
+
24
+ it "should be able to add a dependencies to the task definition" do
25
+ task(:release, :build)
26
+ task(:release, :tag)
27
+ task(:release).dependencies.should eql([:build, :tag])
28
+ end
29
+
30
+ it "should be able to add a block to the task definition" do
31
+ task = task(:release) { "first block" }
32
+ task(:release) { "second block" }
33
+ -> { task(:release) { "released!" } }.should change { task.blocks.length }.by(1)
34
+ end
35
+ end
File without changes
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/helpers"
5
+
6
+ describe Nake::TaskHelpers do
7
+ include Nake::TaskHelpers
8
+ describe "#sh" do
9
+ it "should be able to execute external commands"
10
+ it "should show which command runs"
11
+ it "should show STDOUT of the command"
12
+ it "should show STDERR of the command"
13
+ end
14
+ end
File without changes
@@ -0,0 +1,72 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/rule"
5
+
6
+ describe Nake::Rule do
7
+ before(:each) do
8
+ Nake::Rule.rules.clear
9
+ end
10
+
11
+ describe "[]" do
12
+ it "should find rule with given name if the name is a symbol"
13
+ it "should find rule with given name if the name is a string"
14
+ it "should find rule with given alias if the alias is a symbol"
15
+ it "should find rule with given alias if the alias is a string"
16
+ end
17
+
18
+ describe "[]=" do
19
+ it "should add the rule into the Nake::Rule.rules hash with stringified key"
20
+ end
21
+
22
+ describe ".rules" do
23
+ end
24
+
25
+ describe ".new" do
26
+ it "should returns already existing rule object if this object exists" do
27
+ rule = Nake::Rule.new(:release)
28
+ Nake::Rule.new(:release).object_id.should eql(rule.object_id)
29
+ end
30
+ end
31
+
32
+ it "should take name as a first argument" do
33
+ Nake::Rule.new("name").name.should eql(:name)
34
+ end
35
+
36
+ it "should take name as a first argument" do
37
+ Nake::Rule.new(:name).name.should eql(:name)
38
+ end
39
+
40
+ describe "#define" do
41
+ it "should puts block into the rule.blocks collection" do
42
+ rule = Nake::Rule.new(:name)
43
+ -> { rule.define { "a block" } }.should change { rule.blocks.length }.by(1)
44
+ end
45
+ end
46
+
47
+ describe "#hidden?" do
48
+ it "should not be hidden by default" do
49
+ rule = Nake::Rule.new(:name)
50
+ rule.should_not be_hidden
51
+ end
52
+
53
+ it "should be true if the rule is hidden" do
54
+ Nake::Rule.new(:name).tap do |rule|
55
+ rule.hidden = true
56
+ rule.should be_hidden
57
+ end
58
+ end
59
+
60
+ it "should be false if the rule isn't hidden" do
61
+ Nake::Rule.new(:name).tap do |rule|
62
+ rule.hidden = false
63
+ rule.should_not be_hidden
64
+ end
65
+ end
66
+ end
67
+
68
+ describe "#call" do
69
+ it "should call all dependencies"
70
+ it "should call all blocks of the given rule"
71
+ end
72
+ end
@@ -0,0 +1,72 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/task"
5
+
6
+ describe Nake::Task do
7
+ before(:each) do
8
+ Nake::Task.tasks.clear
9
+ end
10
+
11
+ describe "[]" do
12
+ it "should find task with given name if the name is a symbol"
13
+ it "should find task with given name if the name is a string"
14
+ it "should find task with given alias if the alias is a symbol"
15
+ it "should find task with given alias if the alias is a string"
16
+ end
17
+
18
+ describe "[]=" do
19
+ it "should add the task into the Task.tasks hash with stringified key"
20
+ end
21
+
22
+ describe ".tasks" do
23
+ end
24
+
25
+ describe ".new" do
26
+ it "should returns already existing task object if this object exists" do
27
+ task = Task.new(:release)
28
+ Task.new(:release).object_id.should eql(task.object_id)
29
+ end
30
+ end
31
+
32
+ it "should take name as a first argument" do
33
+ Task.new("name").name.should eql(:name)
34
+ end
35
+
36
+ it "should take name as a first argument" do
37
+ Task.new(:name).name.should eql(:name)
38
+ end
39
+
40
+ describe "#define" do
41
+ it "should puts block into the task.blocks collection" do
42
+ task = Task.new(:name)
43
+ -> { task.define { "a block" } }.should change { task.blocks.length }.by(1)
44
+ end
45
+ end
46
+
47
+ describe "#hidden?" do
48
+ it "should not be hidden by default" do
49
+ task = Task.new(:name)
50
+ task.should_not be_hidden
51
+ end
52
+
53
+ it "should be true if the task is hidden" do
54
+ Task.new(:name).tap do |task|
55
+ task.hidden = true
56
+ task.should be_hidden
57
+ end
58
+ end
59
+
60
+ it "should be false if the task isn't hidden" do
61
+ Task.new(:name).tap do |task|
62
+ task.hidden = false
63
+ task.should_not be_hidden
64
+ end
65
+ end
66
+ end
67
+
68
+ describe "#call" do
69
+ it "should call all dependencies"
70
+ it "should call all blocks of the given task"
71
+ end
72
+ end
@@ -0,0 +1,28 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../../spec_helper"
4
+ require "nake/tasks/bundle"
5
+
6
+ describe "Task bundle" do
7
+ before(:each) do
8
+ @task = Nake::Task[:bundle]
9
+ @bundler = Object.new.define_singleton_method(:invoke) { |*args| args }
10
+ @task.define_singleton_method(:bundler) { @bundler }
11
+ end
12
+
13
+ it "should invoke bundler with --cached by default" do
14
+ @task.call.should include("--cached")
15
+ end
16
+
17
+ it "should invoke bundler without --cached if --no-cached argument is provided" do
18
+ @task.call(cached: false).should_not include("--cached")
19
+ end
20
+
21
+ it "should not pass --no-cached argument to bundler" do
22
+ @task.call(cached: false).should_not include("--no-cached")
23
+ end
24
+
25
+ it "should pass all other arguments to bundler" do
26
+ @task.call("--only", "development").should eql(["--only", "development"])
27
+ end
28
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,48 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+
5
+ load "nake/tasks.rb"
6
+ @result = STDOUT.capture { Task["-T"].call }
7
+
8
+ describe "Default tasks" do
9
+ describe "-H" do
10
+ before(:each) do
11
+ load "nake/tasks.rb"
12
+ end
13
+
14
+ it "should be available as a -H or --help" do
15
+ Task["-H"].should eql(Task["--help"])
16
+ end
17
+
18
+ it "should print a message about using -T and exit" do
19
+ -> { Task["-H"].call }.should raise_error(SystemExit, /-T/)
20
+ end
21
+ end
22
+
23
+ describe "-T" do
24
+ before(:each) do
25
+ load "nake/tasks.rb"
26
+ task(:release, :build, :tag)
27
+ @result = STDOUT.capture { Task["-T"].call }
28
+ end
29
+
30
+ it "should list all available tasks" do
31
+ @result.should match("release")
32
+ end
33
+
34
+ it "should show description if there is any"
35
+
36
+ it "should list dependencies if some are available"
37
+
38
+ it "should list aliases"
39
+
40
+ it "should not show hidden tasks" do
41
+ @result.should_not match("-H")
42
+ end
43
+ end
44
+
45
+ describe "-i" do
46
+ # TODO
47
+ end
48
+ end
@@ -0,0 +1,84 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/template"
5
+
6
+ describe Nake::Template do
7
+ describe ".new" do
8
+ it "should take one argument with path to the file" do
9
+ -> { Nake::Template.new("spec/stubs/database.yml.tt") }.should_not raise_error
10
+ end
11
+ end
12
+
13
+ describe "#render" do
14
+ before(:each) do
15
+ @template = Nake::Template.new("spec/stubs/database.yml.tt")
16
+ end
17
+
18
+ it "should generate a string" do
19
+ output = @template.render(adapter: "sqlite3", name: "blog")
20
+ output.should match("database: blog_development")
21
+ output.should match("database: blog_test")
22
+ end
23
+ end
24
+ end
25
+
26
+ describe Nake::ErbTemplate do
27
+ describe ".new" do
28
+ it "should take one argument with path to the file" do
29
+ -> { Nake::ErbTemplate.new("spec/stubs/database.yml.erb") }.should_not raise_error
30
+ end
31
+ end
32
+
33
+ describe "#render" do
34
+ before(:each) do
35
+ @template = Nake::ErbTemplate.new("spec/stubs/database.yml.erb")
36
+ end
37
+
38
+ it "should generate a string" do
39
+ output = @template.render(adapter: "sqlite3", name: "blog")
40
+ output.should match("database: blog_development")
41
+ output.should match("database: blog_test")
42
+ end
43
+ end
44
+ end
45
+
46
+ describe Nake::TaskHelpers do
47
+ include Nake::TaskHelpers
48
+
49
+ after(:each) do
50
+ FileUtils.rm_rf "spec/stubs/database.yml"
51
+ end
52
+
53
+ describe "#template" do
54
+ before(:each) do
55
+ template "spec/stubs/database.yml.tt", "spec/stubs/database.yml", adapter: "sqlite3", name: "blog"
56
+ end
57
+
58
+ it "should create a new file" do
59
+ File.exist?("spec/stubs/database.yml").should be_true
60
+ end
61
+
62
+ it "should be filled with the data from the template" do
63
+ content = File.read("spec/stubs/database.yml")
64
+ content.should match("database: blog_development")
65
+ content.should match("database: blog_test")
66
+ end
67
+ end
68
+
69
+ describe "#erb" do
70
+ before(:each) do
71
+ erb "spec/stubs/database.yml.erb", "spec/stubs/database.yml", adapter: "sqlite3", name: "blog"
72
+ end
73
+
74
+ it "should create a new file" do
75
+ File.exist?("spec/stubs/database.yml").should be_true
76
+ end
77
+
78
+ it "should be filled with the data from the template" do
79
+ content = File.read("spec/stubs/database.yml")
80
+ content.should match("database: blog_development")
81
+ content.should match("database: blog_test")
82
+ end
83
+ end
84
+ end