do_riak 0.10.1.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -0
- data/Gemfile +9 -0
- data/LICENSE +20 -0
- data/README.textile +23 -0
- data/TODO.txt +4 -0
- data/deps.rip +8 -0
- data/do_riak.gemspec +40 -0
- data/do_riak.pre.gemspec +8 -0
- data/gems/cache/bacon-1.1.0.gem +0 -0
- data/gems/cache/code-cleaner-0.8.1.gem +0 -0
- data/gems/cache/nake-0.0.8.gem +0 -0
- data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
- data/gems/environment.rb +107 -0
- data/gems/gems/bacon-1.1.0/COPYING +18 -0
- data/gems/gems/bacon-1.1.0/ChangeLog +220 -0
- data/gems/gems/bacon-1.1.0/RDOX +69 -0
- data/gems/gems/bacon-1.1.0/README +290 -0
- data/gems/gems/bacon-1.1.0/Rakefile +138 -0
- data/gems/gems/bacon-1.1.0/bin/bacon +117 -0
- data/gems/gems/bacon-1.1.0/lib/autotest/bacon.rb +36 -0
- data/gems/gems/bacon-1.1.0/lib/autotest/bacon_rspec.rb +2 -0
- data/gems/gems/bacon-1.1.0/lib/autotest/discover.rb +9 -0
- data/gems/gems/bacon-1.1.0/lib/bacon.rb +354 -0
- data/gems/gems/bacon-1.1.0/test/spec_bacon.rb +374 -0
- data/gems/gems/bacon-1.1.0/test/spec_should.rb +32 -0
- data/gems/gems/code-cleaner-0.8.1/LICENSE +20 -0
- data/gems/gems/code-cleaner-0.8.1/README.textile +87 -0
- data/gems/gems/code-cleaner-0.8.1/TODO.txt +1 -0
- data/gems/gems/code-cleaner-0.8.1/bin/code-cleaner +143 -0
- data/gems/gems/code-cleaner-0.8.1/code-cleaner-0.8.gem +0 -0
- data/gems/gems/code-cleaner-0.8.1/code-cleaner.gemspec +25 -0
- data/gems/gems/code-cleaner-0.8.1/support/pre-commit.erb +70 -0
- data/gems/gems/code-cleaner-0.8.1/tasks.rb +13 -0
- data/gems/gems/code-cleaner-0.8.1/tasks/code-cleaner.nake +49 -0
- data/gems/gems/code-cleaner-0.8.1/tasks/code-cleaner.rake +22 -0
- data/gems/gems/code-cleaner-0.8.1/tasks/code-cleaner.thor +35 -0
- data/gems/gems/nake-0.0.8/CHANGELOG +48 -0
- data/gems/gems/nake-0.0.8/LICENSE +20 -0
- data/gems/gems/nake-0.0.8/README.textile +39 -0
- data/gems/gems/nake-0.0.8/TODO.txt +23 -0
- data/gems/gems/nake-0.0.8/bin/nake +66 -0
- data/gems/gems/nake-0.0.8/bin/nrake +4 -0
- data/gems/gems/nake-0.0.8/bin/rake2nake +1 -0
- data/gems/gems/nake-0.0.8/bin/snake +41 -0
- data/gems/gems/nake-0.0.8/bm/Rakefile +28 -0
- data/gems/gems/nake-0.0.8/bm/bms.rb +56 -0
- data/gems/gems/nake-0.0.8/bm/output.txt +5 -0
- data/gems/gems/nake-0.0.8/bm/tasks.rb +21 -0
- data/gems/gems/nake-0.0.8/bm/tmp/test.c +6 -0
- data/gems/gems/nake-0.0.8/bm/tmp/www/index.html +1 -0
- data/gems/gems/nake-0.0.8/deps.rb +5 -0
- data/gems/gems/nake-0.0.8/deps.rip +5 -0
- data/gems/gems/nake-0.0.8/examples/arguments.rb +38 -0
- data/gems/gems/nake-0.0.8/examples/basic.rb +5 -0
- data/gems/gems/nake-0.0.8/examples/boot.rb +18 -0
- data/gems/gems/nake-0.0.8/examples/complex.rb +9 -0
- data/gems/gems/nake-0.0.8/examples/configuration.rb +15 -0
- data/gems/gems/nake-0.0.8/examples/default.rb +10 -0
- data/gems/gems/nake-0.0.8/examples/default_proc.rb +11 -0
- data/gems/gems/nake-0.0.8/examples/dependencies.rb +10 -0
- data/gems/gems/nake-0.0.8/examples/description.rb +33 -0
- data/gems/gems/nake-0.0.8/examples/file.rb +22 -0
- data/gems/gems/nake-0.0.8/examples/helpers.rb +3 -0
- data/gems/gems/nake-0.0.8/examples/invoking.rb +14 -0
- data/gems/gems/nake-0.0.8/examples/rules.rb +0 -0
- data/gems/gems/nake-0.0.8/examples/script.rb +20 -0
- data/gems/gems/nake-0.0.8/examples/task_arguments.rb +27 -0
- data/gems/gems/nake-0.0.8/features/arguments.feature +22 -0
- data/gems/gems/nake-0.0.8/features/basic.feature +6 -0
- data/gems/gems/nake-0.0.8/features/boot.feature +5 -0
- data/gems/gems/nake-0.0.8/features/builtin_arguments.feature +14 -0
- data/gems/gems/nake-0.0.8/features/complex.feature +6 -0
- data/gems/gems/nake-0.0.8/features/configuration.feature +10 -0
- data/gems/gems/nake-0.0.8/features/default.feature +10 -0
- data/gems/gems/nake-0.0.8/features/default_proc.feature +6 -0
- data/gems/gems/nake-0.0.8/features/dependencies.feature +16 -0
- data/gems/gems/nake-0.0.8/features/description.feature +0 -0
- data/gems/gems/nake-0.0.8/features/env.rb +11 -0
- data/gems/gems/nake-0.0.8/features/executable.feature +29 -0
- data/gems/gems/nake-0.0.8/features/file.feature +23 -0
- data/gems/gems/nake-0.0.8/features/helpers.feature +6 -0
- data/gems/gems/nake-0.0.8/features/invoking.feature +14 -0
- data/gems/gems/nake-0.0.8/features/rules.feature +0 -0
- data/gems/gems/nake-0.0.8/features/script.feature +10 -0
- data/gems/gems/nake-0.0.8/features/steps.rb +39 -0
- data/gems/gems/nake-0.0.8/features/task_arguments.feature +10 -0
- data/gems/gems/nake-0.0.8/lib/nake.rb +103 -0
- data/gems/gems/nake-0.0.8/lib/nake/abstract_task.rb +175 -0
- data/gems/gems/nake-0.0.8/lib/nake/args.rb +65 -0
- data/gems/gems/nake-0.0.8/lib/nake/argv.rb +47 -0
- data/gems/gems/nake-0.0.8/lib/nake/colors.rb +22 -0
- data/gems/gems/nake-0.0.8/lib/nake/dsl.rb +70 -0
- data/gems/gems/nake-0.0.8/lib/nake/file_task.rb +62 -0
- data/gems/gems/nake-0.0.8/lib/nake/helpers.rb +65 -0
- data/gems/gems/nake-0.0.8/lib/nake/rake.rb +38 -0
- data/gems/gems/nake-0.0.8/lib/nake/rule.rb +35 -0
- data/gems/gems/nake-0.0.8/lib/nake/struct_hash.rb +22 -0
- data/gems/gems/nake-0.0.8/lib/nake/task.rb +6 -0
- data/gems/gems/nake-0.0.8/lib/nake/tasks/bundle.rb +30 -0
- data/gems/gems/nake-0.0.8/lib/nake/tasks/clean.rb +12 -0
- data/gems/gems/nake-0.0.8/lib/nake/tasks/gem.rb +29 -0
- data/gems/gems/nake-0.0.8/lib/nake/tasks/release.rb +43 -0
- data/gems/gems/nake-0.0.8/lib/nake/tasks/rip.rb +33 -0
- data/gems/gems/nake-0.0.8/lib/nake/tasks/spec.rb +20 -0
- data/gems/gems/nake-0.0.8/lib/nake/template.rb +51 -0
- data/gems/gems/nake-0.0.8/nake-0.0.8.pre.gem +0 -0
- data/gems/gems/nake-0.0.8/nake.gemspec +42 -0
- data/gems/gems/nake-0.0.8/nake.pre.gemspec +8 -0
- data/gems/gems/nake-0.0.8/spec/nake/abstract_task_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/args_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/argv_spec.rb +51 -0
- data/gems/gems/nake-0.0.8/spec/nake/colors_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/dsl_spec.rb +35 -0
- data/gems/gems/nake-0.0.8/spec/nake/file_task_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/helpers_spec.rb +14 -0
- data/gems/gems/nake-0.0.8/spec/nake/rake_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/rule_spec.rb +72 -0
- data/gems/gems/nake-0.0.8/spec/nake/struct_hash_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/task_spec.rb +72 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks/bundle_spec.rb +28 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks/clean_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks/gem_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks/release_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks/rip_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks/spec_spec.rb +0 -0
- data/gems/gems/nake-0.0.8/spec/nake/tasks_spec.rb +48 -0
- data/gems/gems/nake-0.0.8/spec/nake/template_spec.rb +84 -0
- data/gems/gems/nake-0.0.8/spec/nake_spec.rb +9 -0
- data/gems/gems/nake-0.0.8/spec/spec.opts +5 -0
- data/gems/gems/nake-0.0.8/spec/spec_helper.rb +29 -0
- data/gems/gems/nake-0.0.8/spec/stubs/database.yml.erb +9 -0
- data/gems/gems/nake-0.0.8/spec/stubs/database.yml.tt +9 -0
- data/gems/gems/nake-0.0.8/tasks.rb +42 -0
- data/gems/gems/term-ansicolor-1.0.4/CHANGES +22 -0
- data/gems/gems/term-ansicolor-1.0.4/COPYING +340 -0
- data/gems/gems/term-ansicolor-1.0.4/README +31 -0
- data/gems/gems/term-ansicolor-1.0.4/Rakefile +86 -0
- data/gems/gems/term-ansicolor-1.0.4/VERSION +1 -0
- data/gems/gems/term-ansicolor-1.0.4/doc-main.txt +119 -0
- data/gems/gems/term-ansicolor-1.0.4/examples/cdiff.rb +19 -0
- data/gems/gems/term-ansicolor-1.0.4/examples/example.rb +89 -0
- data/gems/gems/term-ansicolor-1.0.4/install.rb +15 -0
- data/gems/gems/term-ansicolor-1.0.4/lib/term/ansicolor.rb +102 -0
- data/gems/gems/term-ansicolor-1.0.4/lib/term/ansicolor/version.rb +10 -0
- data/gems/gems/term-ansicolor-1.0.4/term-ansicolor.gemspec +20 -0
- data/gems/specifications/bacon-1.1.0.gemspec +30 -0
- data/gems/specifications/code-cleaner-0.8.1.gemspec +31 -0
- data/gems/specifications/nake-0.0.8.gemspec +35 -0
- data/gems/specifications/term-ansicolor-1.0.4.gemspec +30 -0
- data/lib/do_riak.rb +10 -0
- data/lib/do_riak/errors.rb +11 -0
- data/lib/do_riak/transaction.rb +24 -0
- data/lib/do_riak/version.rb +7 -0
- data/script/bacon +3 -0
- data/script/code-cleaner +3 -0
- data/script/nake +3 -0
- data/spec/command_spec.rb +8 -0
- data/spec/connection_spec.rb +17 -0
- data/spec/reader_spec.rb +8 -0
- data/spec/result_spec.rb +12 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/typecast/array_spec.rb +8 -0
- data/spec/typecast/bigdecimal_spec.rb +8 -0
- data/spec/typecast/boolean_spec.rb +8 -0
- data/spec/typecast/byte_array_spec.rb +8 -0
- data/spec/typecast/class_spec.rb +8 -0
- data/spec/typecast/date_spec.rb +8 -0
- data/spec/typecast/datetime_spec.rb +8 -0
- data/spec/typecast/float_spec.rb +12 -0
- data/spec/typecast/integer_spec.rb +8 -0
- data/spec/typecast/nil_spec.rb +16 -0
- data/spec/typecast/other_spec.rb +8 -0
- data/spec/typecast/range_spec.rb +8 -0
- data/spec/typecast/string_spec.rb +8 -0
- data/spec/typecast/time_spec.rb +8 -0
- data/tasks.rb +37 -0
- metadata +238 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
Bacon
|
2
|
+
- should have should.satisfy
|
3
|
+
- should have should.equal
|
4
|
+
- should have should.raise
|
5
|
+
- should have should.raise with a block
|
6
|
+
- should have a should.raise should return the exception
|
7
|
+
- should have should.be.an.instance_of
|
8
|
+
- should have should.be.nil
|
9
|
+
- should have should.include
|
10
|
+
- should have should.be.a.kind_of
|
11
|
+
- should have should.match
|
12
|
+
- should have should.not.raise
|
13
|
+
- should have should.throw
|
14
|
+
- should have should.not.satisfy
|
15
|
+
- should have should.not.equal
|
16
|
+
- should have should.not.match
|
17
|
+
- should have should.be.identical_to/same_as
|
18
|
+
- should have should.respond_to
|
19
|
+
- should have should.be.close
|
20
|
+
- should support multiple negation
|
21
|
+
- should have should.<predicate>
|
22
|
+
- should have should <operator> (>, >=, <, <=, ===)
|
23
|
+
- should allow for custom shoulds
|
24
|
+
- should have should.flunk
|
25
|
+
|
26
|
+
before/after
|
27
|
+
- should run in the right order
|
28
|
+
when nested
|
29
|
+
- should run from higher level
|
30
|
+
- should run at the nested level
|
31
|
+
- should run in the right order
|
32
|
+
|
33
|
+
- should not run from lower level
|
34
|
+
when nested at a sibling level
|
35
|
+
- should not run from sibling level
|
36
|
+
|
37
|
+
|
38
|
+
shared/behaves_like
|
39
|
+
- gets called where it is included
|
40
|
+
- raises NameError when the context is not found
|
41
|
+
- gets called where it is included
|
42
|
+
- can access data
|
43
|
+
|
44
|
+
describe arguments
|
45
|
+
- should work with stringstring
|
46
|
+
|
47
|
+
|
48
|
+
- should work with symbolsbehaviour
|
49
|
+
|
50
|
+
|
51
|
+
- should work with modulesBacon
|
52
|
+
|
53
|
+
|
54
|
+
- should work with namespaced modulesBacon::Context
|
55
|
+
|
56
|
+
|
57
|
+
- should work with multiple argumentsBacon::Context empty
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
#should shortcut for #it('should')
|
62
|
+
- should be called
|
63
|
+
- should save some characters by typing should
|
64
|
+
- should save characters even on failure
|
65
|
+
- should work nested
|
66
|
+
- should add new specifications
|
67
|
+
- should have been called
|
68
|
+
|
69
|
+
44 specifications (375 requirements), 0 failures, 0 errors
|
@@ -0,0 +1,290 @@
|
|
1
|
+
= Bacon -- small RSpec clone.
|
2
|
+
|
3
|
+
"Truth will sooner come out from error than from confusion."
|
4
|
+
---Francis Bacon
|
5
|
+
|
6
|
+
Bacon is a small RSpec clone weighing less than 350 LoC but
|
7
|
+
nevertheless providing all essential features.
|
8
|
+
|
9
|
+
|
10
|
+
== Whirl-wind tour
|
11
|
+
|
12
|
+
require 'bacon'
|
13
|
+
|
14
|
+
describe 'A new array' do
|
15
|
+
before do
|
16
|
+
@ary = Array.new
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should be empty' do
|
20
|
+
@ary.should.be.empty
|
21
|
+
@ary.should.not.include 1
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should have zero size' do
|
25
|
+
@ary.size.should.equal 0
|
26
|
+
@ary.size.should.be.close 0.1, 0.5
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should raise on trying fetch any index' do
|
30
|
+
lambda { @ary.fetch 0 }.
|
31
|
+
should.raise(IndexError).
|
32
|
+
message.should.match(/out of array/)
|
33
|
+
|
34
|
+
# Alternatively:
|
35
|
+
should.raise(IndexError) { @ary.fetch 0 }
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should have an object identity' do
|
39
|
+
@ary.should.not.be.same_as Array.new
|
40
|
+
end
|
41
|
+
|
42
|
+
# Custom assertions are trivial to do, they are lambdas returning a
|
43
|
+
# boolean vale:
|
44
|
+
palindrome = lambda { |obj| obj == obj.reverse }
|
45
|
+
it 'should be a palindrome' do
|
46
|
+
@ary.should.be.a palindrome
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should have super powers' do
|
50
|
+
should.flunk "no super powers found"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
Now run it:
|
55
|
+
|
56
|
+
$ bacon whirlwind.rb
|
57
|
+
A new array
|
58
|
+
- should be empty
|
59
|
+
- should have zero size
|
60
|
+
- should raise on trying fetch any index
|
61
|
+
- should have an object identity
|
62
|
+
- should be a palindrome
|
63
|
+
- should have super powers [FAILED]
|
64
|
+
|
65
|
+
Bacon::Error: no super powers found
|
66
|
+
./whirlwind.rb:39: A new array - should have super powers
|
67
|
+
./whirlwind.rb:38
|
68
|
+
./whirlwind.rb:3
|
69
|
+
|
70
|
+
6 specifications (9 requirements), 1 failures, 0 errors
|
71
|
+
|
72
|
+
If you want shorter output, use the Test::Unit format:
|
73
|
+
|
74
|
+
$ bacon -q whirlwind.rb
|
75
|
+
.....F
|
76
|
+
Bacon::Error: no super powers found
|
77
|
+
./whirlwind.rb:39: A new array - should have super powers
|
78
|
+
./whirlwind.rb:38
|
79
|
+
./whirlwind.rb:3
|
80
|
+
|
81
|
+
6 tests, 9 assertions, 1 failures, 0 errors
|
82
|
+
|
83
|
+
It also supports TAP:
|
84
|
+
|
85
|
+
$ bacon -p whirlwind.rb
|
86
|
+
ok 1 - should be empty
|
87
|
+
ok 2 - should have zero size
|
88
|
+
ok 3 - should raise on trying fetch any index
|
89
|
+
ok 4 - should have an object identity
|
90
|
+
ok 5 - should be a palindrome
|
91
|
+
not ok 6 - should have super powers: FAILED
|
92
|
+
# Bacon::Error: no super powers found
|
93
|
+
# ./whirlwind.rb:39: A new array - should have super powers
|
94
|
+
# ./whirlwind.rb:38
|
95
|
+
# ./whirlwind.rb:3
|
96
|
+
1..6
|
97
|
+
# 6 tests, 9 assertions, 1 failures, 0 errors
|
98
|
+
|
99
|
+
$ bacon -p whirlwind.rb | taptap -q
|
100
|
+
Tests took 0.00 seconds.
|
101
|
+
FAILED tests 6
|
102
|
+
6) should have super powers: FAILED
|
103
|
+
|
104
|
+
Failed 1/6 tests, 83.33% okay.
|
105
|
+
|
106
|
+
(taptap is available from http://chneukirchen.org/repos/taptap/)
|
107
|
+
|
108
|
+
As of Bacon 1.1, it also supports Knock:
|
109
|
+
|
110
|
+
$ bacon -k whirlwind.rb
|
111
|
+
ok - should be empty
|
112
|
+
ok - should have zero size
|
113
|
+
ok - should raise on trying fetch any index
|
114
|
+
ok - should have an object identity
|
115
|
+
ok - should be a palindrome
|
116
|
+
not ok - should have super powers: FAILED
|
117
|
+
# Bacon::Error: no super powers found
|
118
|
+
# ./whirlwind.rb:39: A new array - should have super powers
|
119
|
+
# ./whirlwind.rb:38
|
120
|
+
# ./whirlwind.rb:3
|
121
|
+
|
122
|
+
$ bacon -k whirlwind.rb | kn-sum
|
123
|
+
6 tests, 1 failed (83.3333% succeeded)
|
124
|
+
|
125
|
+
(knock is available from http://github.com/chneukirchen/knock/)
|
126
|
+
|
127
|
+
|
128
|
+
== Implemented assertions
|
129
|
+
|
130
|
+
* should.<predicate> and should.be.<predicate>
|
131
|
+
* should.equal
|
132
|
+
* should.match
|
133
|
+
* should.be.identical_to / should.be.same_as
|
134
|
+
* should.raise(*exceptions) { }
|
135
|
+
* should.change { }
|
136
|
+
* should.throw(symbol) { }
|
137
|
+
* should.satisfy { |object| }
|
138
|
+
|
139
|
+
|
140
|
+
== Added core predicates
|
141
|
+
|
142
|
+
* Object#true?
|
143
|
+
* Object#false?
|
144
|
+
* Proc#change?
|
145
|
+
* Proc#raise?
|
146
|
+
* Proc#throw?
|
147
|
+
* Numeric#close?
|
148
|
+
|
149
|
+
|
150
|
+
== before/after
|
151
|
+
|
152
|
+
before and after need to be defined before the first specification in
|
153
|
+
a context and are run before and after each specification.
|
154
|
+
|
155
|
+
As of Bacon 1.1, before and after do nest in nested contexts.
|
156
|
+
|
157
|
+
|
158
|
+
== Shared contexts
|
159
|
+
|
160
|
+
You can define shared contexts in Bacon like this:
|
161
|
+
|
162
|
+
shared "an empty container" do
|
163
|
+
it "should have size zero" do
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should be empty" do
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
context "A new array" do
|
171
|
+
behaves_like "an empty container"
|
172
|
+
end
|
173
|
+
|
174
|
+
These contexts are not executed on their own, but can be included with
|
175
|
+
behaves_like in other contexts. You can use shared contexts to
|
176
|
+
structure suites with many recurring specifications.
|
177
|
+
|
178
|
+
|
179
|
+
== Matchers
|
180
|
+
|
181
|
+
Custom matchers are simply lambdas returning a boolean value, for
|
182
|
+
example:
|
183
|
+
|
184
|
+
def shorter_than(max_size)
|
185
|
+
lambda { |obj| obj.size < max_size }
|
186
|
+
end
|
187
|
+
|
188
|
+
[1,2,3].should.be shorter_than(5)
|
189
|
+
|
190
|
+
You can use modules and extend to group matchers for use in multiple
|
191
|
+
contexts.
|
192
|
+
|
193
|
+
|
194
|
+
== bacon standalone runner
|
195
|
+
|
196
|
+
-s, --specdox do AgileDox-like output (default)
|
197
|
+
-q, --quiet do Test::Unit-like non-verbose output
|
198
|
+
-p, --tap do TAP (Test Anything Protocol) output
|
199
|
+
-k, --knock do Knock output
|
200
|
+
-o, --output FORMAT do FORMAT (SpecDox/TestUnit/Tap) output
|
201
|
+
-Q, --no-backtrace don't print backtraces
|
202
|
+
-a, --automatic gather tests from ./test/, include ./lib/
|
203
|
+
-n, --name NAME runs tests matching regexp NAME
|
204
|
+
-t, --testcase TESTCASE runs tests in TestCases matching regexp TESTCASE
|
205
|
+
|
206
|
+
If you don't want to use the standalone runner, run
|
207
|
+
Bacon.summary_on_exit to install an exit handler showing the summary.
|
208
|
+
|
209
|
+
|
210
|
+
== Object#should
|
211
|
+
|
212
|
+
You can use Object#should outside of contexts, where the result of
|
213
|
+
assertion will be returned as a boolean. This is nice for
|
214
|
+
demonstrations, quick checks and doctest tests.
|
215
|
+
|
216
|
+
>> require 'bacon'
|
217
|
+
>> (1 + 1).should.equal 2
|
218
|
+
=> true
|
219
|
+
>> (6*9).should.equal 42
|
220
|
+
=> false
|
221
|
+
|
222
|
+
|
223
|
+
== Bacon with autotest
|
224
|
+
|
225
|
+
Since version 1.0, there is autotest support. You need to tag your
|
226
|
+
test directories (test/ or spec/) by creating an .bacon file there.
|
227
|
+
Autotest then will find it. bin/bacon needs to be in PATH or RUBYPATH.
|
228
|
+
|
229
|
+
|
230
|
+
== Converting specs
|
231
|
+
|
232
|
+
spec-converter is a simple tool to convert test-unit or dust style
|
233
|
+
tests to test/spec specs.
|
234
|
+
|
235
|
+
It can be found at http://opensource.thinkrelevance.com/wiki/spec_converter.
|
236
|
+
|
237
|
+
|
238
|
+
== Thanks to
|
239
|
+
|
240
|
+
* Michael Fellinger, for fixing Bacon for 1.9 and various improvements.
|
241
|
+
* Gabriele Renzi, for implementing Context#should.
|
242
|
+
* James Tucker, for the autotest support.
|
243
|
+
* Yossef Mendelssohn, for nested contexts.
|
244
|
+
* everyone contributing bug fixes.
|
245
|
+
|
246
|
+
|
247
|
+
== History
|
248
|
+
|
249
|
+
* January 7, 2008: First public release 0.9.
|
250
|
+
|
251
|
+
* July 6th, 2008: Second public release 1.0.
|
252
|
+
* Add Context#should as a shortcut for Context#it('should ' + _).
|
253
|
+
* describe now supports multiple arguments for better organization.
|
254
|
+
* Empty specifications are now erroneous.
|
255
|
+
* after-blocks run in the case of exceptions too.
|
256
|
+
* Autotest support.
|
257
|
+
* Bug fixes.
|
258
|
+
|
259
|
+
* November 30th, 2008: Third public release 1.1.
|
260
|
+
* Nested before/after.
|
261
|
+
* Add -Q/--no-backtraces to not show details about failed specifications.
|
262
|
+
* Add Knock output.
|
263
|
+
* Bug fixes.
|
264
|
+
|
265
|
+
|
266
|
+
== Contact
|
267
|
+
|
268
|
+
Please mail bugs, suggestions and patches to
|
269
|
+
<mailto:chneukirchen@gmail.com>.
|
270
|
+
|
271
|
+
Git repository (patches rebased on HEAD are most welcome):
|
272
|
+
http://github.com/chneukirchen/bacon
|
273
|
+
git://github.com/chneukirchen/bacon.git
|
274
|
+
|
275
|
+
|
276
|
+
== Copying
|
277
|
+
|
278
|
+
Copyright (C) 2007, 2008 Christian Neukirchen <purl.org/net/chneukirchen>
|
279
|
+
|
280
|
+
Bacon is freely distributable under the terms of an MIT-style license.
|
281
|
+
See COPYING or http://www.opensource.org/licenses/mit-license.php.
|
282
|
+
|
283
|
+
|
284
|
+
== Links
|
285
|
+
|
286
|
+
Behavior-Driven Development:: <http://behaviour-driven.org/>
|
287
|
+
RSpec:: <http://rspec.rubyforge.org/>
|
288
|
+
test/spec:: <http://test-spec.rubyforge.org/>
|
289
|
+
|
290
|
+
Christian Neukirchen:: <http://chneukirchen.org/>
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# Rakefile for Bacon. -*-ruby-*-
|
2
|
+
require 'rake/rdoctask'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
|
6
|
+
desc "Run all the tests"
|
7
|
+
task :default => [:test]
|
8
|
+
|
9
|
+
desc "Do predistribution stuff"
|
10
|
+
task :predist => [:chmod, :changelog, :rdoc]
|
11
|
+
|
12
|
+
|
13
|
+
desc "Make an archive as .tar.gz"
|
14
|
+
task :dist => [:test, :predist] do
|
15
|
+
sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
|
16
|
+
sh "pax -waf #{release}.tar -s ':^:#{release}/:' RDOX ChangeLog doc"
|
17
|
+
sh "gzip -f -9 #{release}.tar"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Helper to retrieve the "revision number" of the git tree.
|
21
|
+
def git_tree_version
|
22
|
+
if File.directory?(".git")
|
23
|
+
@tree_version ||= `git describe`.strip.sub('-', '.')
|
24
|
+
@tree_version << ".0" unless @tree_version.count('.') == 2
|
25
|
+
else
|
26
|
+
$: << "lib"
|
27
|
+
require 'bacon'
|
28
|
+
@tree_version = Bacon::VERSION
|
29
|
+
end
|
30
|
+
@tree_version
|
31
|
+
end
|
32
|
+
|
33
|
+
def gem_version
|
34
|
+
git_tree_version.gsub(/-.*/, '')
|
35
|
+
end
|
36
|
+
|
37
|
+
def release
|
38
|
+
"bacon-#{git_tree_version}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def manifest
|
42
|
+
`git ls-files`.split("\n") - [".gitignore"]
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
desc "Make binaries executable"
|
47
|
+
task :chmod do
|
48
|
+
Dir["bin/*"].each { |binary| File.chmod(0775, binary) }
|
49
|
+
end
|
50
|
+
|
51
|
+
desc "Generate a ChangeLog"
|
52
|
+
task :changelog do
|
53
|
+
File.open("ChangeLog", "w") { |out|
|
54
|
+
`git log -z`.split("\0").map { |chunk|
|
55
|
+
author = chunk[/Author: (.*)/, 1].strip
|
56
|
+
date = chunk[/Date: (.*)/, 1].strip
|
57
|
+
desc, detail = $'.strip.split("\n", 2)
|
58
|
+
detail ||= ""
|
59
|
+
detail = detail.gsub(/.*darcs-hash:.*/, '')
|
60
|
+
detail.rstrip!
|
61
|
+
out.puts "#{date} #{author}"
|
62
|
+
out.puts " * #{desc.strip}"
|
63
|
+
out.puts detail unless detail.empty?
|
64
|
+
out.puts
|
65
|
+
}
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
desc "Generate RDox"
|
71
|
+
task "RDOX" do
|
72
|
+
sh "bin/bacon -Ilib --automatic --specdox >RDOX"
|
73
|
+
end
|
74
|
+
|
75
|
+
desc "Run all the tests"
|
76
|
+
task :test do
|
77
|
+
ruby "bin/bacon -Ilib --automatic --quiet"
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
begin
|
82
|
+
$" << "sources" if defined? FromSrc
|
83
|
+
require 'rubygems'
|
84
|
+
|
85
|
+
require 'rake'
|
86
|
+
require 'rake/clean'
|
87
|
+
require 'rake/packagetask'
|
88
|
+
require 'rake/gempackagetask'
|
89
|
+
require 'fileutils'
|
90
|
+
rescue LoadError
|
91
|
+
# Too bad.
|
92
|
+
else
|
93
|
+
spec = Gem::Specification.new do |s|
|
94
|
+
s.name = "bacon"
|
95
|
+
s.version = gem_version
|
96
|
+
s.platform = Gem::Platform::RUBY
|
97
|
+
s.summary = "a small RSpec clone"
|
98
|
+
|
99
|
+
s.description = <<-EOF
|
100
|
+
Bacon is a small RSpec clone weighing less than 350 LoC but
|
101
|
+
nevertheless providing all essential features.
|
102
|
+
|
103
|
+
http://github.com/chneukirchen/bacon
|
104
|
+
EOF
|
105
|
+
|
106
|
+
s.files = manifest + %w(RDOX ChangeLog)
|
107
|
+
s.bindir = 'bin'
|
108
|
+
s.executables << 'bacon'
|
109
|
+
s.require_path = 'lib'
|
110
|
+
s.has_rdoc = true
|
111
|
+
s.extra_rdoc_files = ['README', 'RDOX']
|
112
|
+
s.test_files = []
|
113
|
+
|
114
|
+
s.author = 'Christian Neukirchen'
|
115
|
+
s.email = 'chneukirchen@gmail.com'
|
116
|
+
s.homepage = 'http://chneukirchen.org/repos/bacon'
|
117
|
+
end
|
118
|
+
|
119
|
+
Rake::GemPackageTask.new(spec) do |p|
|
120
|
+
p.gem_spec = spec
|
121
|
+
p.need_tar = false
|
122
|
+
p.need_zip = false
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
desc "Generate RDoc documentation"
|
127
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
128
|
+
rdoc.options << '--line-numbers' << '--inline-source' <<
|
129
|
+
'--main' << 'README' <<
|
130
|
+
'--title' << 'Bacon Documentation' <<
|
131
|
+
'--charset' << 'utf-8'
|
132
|
+
rdoc.rdoc_dir = "doc"
|
133
|
+
rdoc.rdoc_files.include 'README'
|
134
|
+
rdoc.rdoc_files.include 'COPYING'
|
135
|
+
rdoc.rdoc_files.include 'RDOX'
|
136
|
+
rdoc.rdoc_files.include('lib/bacon.rb')
|
137
|
+
end
|
138
|
+
task :rdoc => ["RDOX"]
|