quarry 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/COPYING +344 -0
- data/MANIFEST +151 -0
- data/METADATA +22 -0
- data/NEWS +8 -0
- data/README +75 -0
- data/VERSION +1 -0
- data/bin/rubybreak +3 -0
- data/bin/xact-ruby +6 -0
- data/demo/spec/demo_check.rb +21 -0
- data/demo/spec/demo_outline.rb +25 -0
- data/demo/test/demo_run.rb +21 -0
- data/doc/manual.html2 +1416 -0
- data/doc/rdoc/classes/Assertion.html +101 -0
- data/doc/rdoc/classes/Assertion/False.html +132 -0
- data/doc/rdoc/classes/Assertion/True.html +137 -0
- data/doc/rdoc/classes/Kernel.html +86 -0
- data/doc/rdoc/classes/Method.html +137 -0
- data/doc/rdoc/classes/Module.html +165 -0
- data/doc/rdoc/classes/Object.html +154 -0
- data/doc/rdoc/classes/Quarry.html +177 -0
- data/doc/rdoc/classes/Quarry/Design.html +170 -0
- data/doc/rdoc/classes/Quarry/Design/Specification.html +265 -0
- data/doc/rdoc/classes/Quarry/Design/Specification/Context.html +174 -0
- data/doc/rdoc/classes/Quarry/MethodProbe.html +267 -0
- data/doc/rdoc/classes/Quarry/Mock.html +89 -0
- data/doc/rdoc/classes/Quarry/Mock/Object.html +276 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/CHANGES.html +100 -0
- data/doc/rdoc/files/COPYING.html +457 -0
- data/doc/rdoc/files/MANIFEST.html +630 -0
- data/doc/rdoc/files/METADATA.html +92 -0
- data/doc/rdoc/files/NEWS.html +99 -0
- data/doc/rdoc/files/README.html +171 -0
- data/doc/rdoc/files/VERSION.html +96 -0
- data/doc/rdoc/files/bin/rubybreak.html +96 -0
- data/doc/rdoc/files/bin/xact-ruby.html +92 -0
- data/doc/rdoc/files/lib/quarry/assert/must_rb.html +96 -0
- data/doc/rdoc/files/lib/quarry/assert/should_rb.html +96 -0
- data/doc/rdoc/files/lib/quarry/assertion_rb.html +96 -0
- data/doc/rdoc/files/lib/quarry/breakout_rb.html +144 -0
- data/doc/rdoc/files/lib/quarry/design/spec_rb.html +100 -0
- data/doc/rdoc/files/lib/quarry/document_rb.html +92 -0
- data/doc/rdoc/files/lib/quarry/loadmonitor_rb.html +92 -0
- data/doc/rdoc/files/lib/quarry/methodprobe_rb.html +111 -0
- data/doc/rdoc/files/lib/quarry/mock/object_rb.html +123 -0
- data/doc/rdoc/files/lib/quarry/mockery_rb.html +115 -0
- data/doc/rdoc/fr_class_index.html +60 -0
- data/doc/rdoc/fr_file_index.html +65 -0
- data/doc/rdoc/fr_method_index.html +77 -0
- data/doc/rdoc/index.html +26 -0
- data/doc/rdoc/rdoc-style.css +175 -0
- data/doc/ri/Assertion/False/assert-i.yaml +10 -0
- data/doc/ri/Assertion/False/cdesc-False.yaml +19 -0
- data/doc/ri/Assertion/False/message-i.yaml +10 -0
- data/doc/ri/Assertion/True/assert-i.yaml +11 -0
- data/doc/ri/Assertion/True/cdesc-True.yaml +24 -0
- data/doc/ri/Assertion/True/message-c.yaml +11 -0
- data/doc/ri/Assertion/True/message-i.yaml +11 -0
- data/doc/ri/Assertion/True/method_missing-i.yaml +11 -0
- data/doc/ri/Assertion/True/new-c.yaml +11 -0
- data/doc/ri/Assertion/cdesc-Assertion.yaml +17 -0
- data/doc/ri/Kernel/cdesc-Kernel.yaml +15 -0
- data/doc/ri/Method/cdesc-Method.yaml +18 -0
- data/doc/ri/Method/migration-i.yaml +12 -0
- data/doc/ri/Method/signature-i.yaml +12 -0
- data/doc/ri/Module/cdesc-Module.yaml +21 -0
- data/doc/ri/Module/doc-i.yaml +16 -0
- data/doc/ri/Module/method_added-i.yaml +10 -0
- data/doc/ri/Object/assert%21-i.yaml +14 -0
- data/doc/ri/Object/assert-i.yaml +14 -0
- data/doc/ri/Object/cdesc-Object.yaml +20 -0
- data/doc/ri/Quarry/Design/Specification/Context/after-i.yaml +10 -0
- data/doc/ri/Quarry/Design/Specification/Context/before-i.yaml +10 -0
- data/doc/ri/Quarry/Design/Specification/Context/cdesc-Context.yaml +24 -0
- data/doc/ri/Quarry/Design/Specification/Context/method_missing-i.yaml +10 -0
- data/doc/ri/Quarry/Design/Specification/Context/specifications-i.yaml +10 -0
- data/doc/ri/Quarry/Design/Specification/cdesc-Specification.yaml +44 -0
- data/doc/ri/Quarry/Design/Specification/check-i.yaml +12 -0
- data/doc/ri/Quarry/Design/Specification/new-c.yaml +12 -0
- data/doc/ri/Quarry/Design/Specification/outline-i.yaml +12 -0
- data/doc/ri/Quarry/Design/cdesc-Design.yaml +22 -0
- data/doc/ri/Quarry/Design/check-c.yaml +12 -0
- data/doc/ri/Quarry/Design/outline-c.yaml +10 -0
- data/doc/ri/Quarry/Design/specification-c.yaml +10 -0
- data/doc/ri/Quarry/Design/specifications-c.yaml +10 -0
- data/doc/ri/Quarry/MethodProbe/cdesc-MethodProbe.yaml +46 -0
- data/doc/ri/Quarry/MethodProbe/duckcall-c.yaml +10 -0
- data/doc/ri/Quarry/MethodProbe/initialize_copy-i.yaml +10 -0
- data/doc/ri/Quarry/MethodProbe/method_missing-i.yaml +10 -0
- data/doc/ri/Quarry/MethodProbe/new-c.yaml +10 -0
- data/doc/ri/Quarry/Mock/Object/cdesc-Object.yaml +52 -0
- data/doc/ri/Quarry/Mock/Object/echo-c.yaml +12 -0
- data/doc/ri/Quarry/Mock/Object/keys-c.yaml +12 -0
- data/doc/ri/Quarry/Mock/Object/mock-c.yaml +12 -0
- data/doc/ri/Quarry/Mock/Object/mocks-c.yaml +10 -0
- data/doc/ri/Quarry/Mock/Object/spin-c.yaml +12 -0
- data/doc/ri/Quarry/Mock/cdesc-Mock.yaml +15 -0
- data/doc/ri/Quarry/Mockery-i.yaml +12 -0
- data/doc/ri/Quarry/cdesc-Quarry.yaml +17 -0
- data/doc/ri/created.rid +1 -0
- data/lib/quarry/assert/must.rb +8 -0
- data/lib/quarry/assert/should.rb +9 -0
- data/lib/quarry/assertion.rb +95 -0
- data/lib/quarry/breakout.rb +45 -0
- data/lib/quarry/design/spec.rb +197 -0
- data/lib/quarry/document.rb +35 -0
- data/lib/quarry/loadmonitor.rb +14 -0
- data/lib/quarry/methodprobe.rb +216 -0
- data/lib/quarry/mock/object.rb +169 -0
- data/lib/quarry/mockery.rb +85 -0
- metadata +214 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
- !ruby/struct:SM::Flow::P
|
7
|
+
body: Assert not an operational relationship.
|
8
|
+
- !ruby/struct:SM::Flow::P
|
9
|
+
body: "4.assert! == 4 #=> Assertion Error"
|
10
|
+
full_name: Object#assert!
|
11
|
+
is_singleton: false
|
12
|
+
name: assert!
|
13
|
+
params: ()
|
14
|
+
visibility: public
|
@@ -0,0 +1,14 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
- !ruby/struct:SM::Flow::P
|
7
|
+
body: Assert a operational relationship.
|
8
|
+
- !ruby/struct:SM::Flow::P
|
9
|
+
body: "4.assert == 3 #=> Assertion Error"
|
10
|
+
full_name: Object#assert
|
11
|
+
is_singleton: false
|
12
|
+
name: assert
|
13
|
+
params: ()
|
14
|
+
visibility: public
|
@@ -0,0 +1,20 @@
|
|
1
|
+
--- !ruby/object:RI::ClassDescription
|
2
|
+
attributes: []
|
3
|
+
|
4
|
+
class_methods: []
|
5
|
+
|
6
|
+
comment:
|
7
|
+
- !ruby/struct:SM::Flow::P
|
8
|
+
body: Copyright (c) 2008 Tiger Ops
|
9
|
+
constants: []
|
10
|
+
|
11
|
+
full_name: Object
|
12
|
+
includes: []
|
13
|
+
|
14
|
+
instance_methods:
|
15
|
+
- !ruby/object:RI::MethodSummary
|
16
|
+
name: assert
|
17
|
+
- !ruby/object:RI::MethodSummary
|
18
|
+
name: assert!
|
19
|
+
name: Object
|
20
|
+
superclass: Object
|
@@ -0,0 +1,24 @@
|
|
1
|
+
--- !ruby/object:RI::ClassDescription
|
2
|
+
attributes: []
|
3
|
+
|
4
|
+
class_methods: []
|
5
|
+
|
6
|
+
comment:
|
7
|
+
- !ruby/struct:SM::Flow::P
|
8
|
+
body: A context provides a "clean room" to build a specification.
|
9
|
+
constants: []
|
10
|
+
|
11
|
+
full_name: Quarry::Design::Specification::Context
|
12
|
+
includes: []
|
13
|
+
|
14
|
+
instance_methods:
|
15
|
+
- !ruby/object:RI::MethodSummary
|
16
|
+
name: after
|
17
|
+
- !ruby/object:RI::MethodSummary
|
18
|
+
name: before
|
19
|
+
- !ruby/object:RI::MethodSummary
|
20
|
+
name: method_missing
|
21
|
+
- !ruby/object:RI::MethodSummary
|
22
|
+
name: specifications
|
23
|
+
name: Context
|
24
|
+
superclass: Object
|
@@ -0,0 +1,10 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
full_name: Quarry::Design::Specification::Context#method_missing
|
7
|
+
is_singleton: false
|
8
|
+
name: method_missing
|
9
|
+
params: (relation, *description, &specification)
|
10
|
+
visibility: public
|
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:RI::ClassDescription
|
2
|
+
attributes:
|
3
|
+
- !ruby/object:RI::Attribute
|
4
|
+
comment:
|
5
|
+
name: after
|
6
|
+
rw: R
|
7
|
+
- !ruby/object:RI::Attribute
|
8
|
+
comment:
|
9
|
+
name: before
|
10
|
+
rw: R
|
11
|
+
- !ruby/object:RI::Attribute
|
12
|
+
comment:
|
13
|
+
name: context
|
14
|
+
rw: R
|
15
|
+
- !ruby/object:RI::Attribute
|
16
|
+
comment:
|
17
|
+
name: description
|
18
|
+
rw: R
|
19
|
+
- !ruby/object:RI::Attribute
|
20
|
+
comment:
|
21
|
+
name: relation
|
22
|
+
rw: R
|
23
|
+
- !ruby/object:RI::Attribute
|
24
|
+
comment:
|
25
|
+
name: specification
|
26
|
+
rw: R
|
27
|
+
class_methods:
|
28
|
+
- !ruby/object:RI::MethodSummary
|
29
|
+
name: new
|
30
|
+
comment:
|
31
|
+
- !ruby/struct:SM::Flow::P
|
32
|
+
body: Design specification. Sepcification can contains sub-specifications.
|
33
|
+
constants: []
|
34
|
+
|
35
|
+
full_name: Quarry::Design::Specification
|
36
|
+
includes: []
|
37
|
+
|
38
|
+
instance_methods:
|
39
|
+
- !ruby/object:RI::MethodSummary
|
40
|
+
name: check
|
41
|
+
- !ruby/object:RI::MethodSummary
|
42
|
+
name: outline
|
43
|
+
name: Specification
|
44
|
+
superclass: Object
|
@@ -0,0 +1,12 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
- !ruby/struct:SM::Flow::P
|
7
|
+
body: Check Specification
|
8
|
+
full_name: Quarry::Design::Specification#check
|
9
|
+
is_singleton: false
|
10
|
+
name: check
|
11
|
+
params: (level=0)
|
12
|
+
visibility: public
|
@@ -0,0 +1,12 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
- !ruby/struct:SM::Flow::P
|
7
|
+
body: New Specification
|
8
|
+
full_name: Quarry::Design::Specification::new
|
9
|
+
is_singleton: true
|
10
|
+
name: new
|
11
|
+
params: (relation, description, context=nil, &specification)
|
12
|
+
visibility: public
|
@@ -0,0 +1,12 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
- !ruby/struct:SM::Flow::P
|
7
|
+
body: Outline Specification
|
8
|
+
full_name: Quarry::Design::Specification#outline
|
9
|
+
is_singleton: false
|
10
|
+
name: outline
|
11
|
+
params: (level=0)
|
12
|
+
visibility: public
|
@@ -0,0 +1,22 @@
|
|
1
|
+
--- !ruby/object:RI::ClassDescription
|
2
|
+
attributes: []
|
3
|
+
|
4
|
+
class_methods:
|
5
|
+
- !ruby/object:RI::MethodSummary
|
6
|
+
name: check
|
7
|
+
- !ruby/object:RI::MethodSummary
|
8
|
+
name: outline
|
9
|
+
- !ruby/object:RI::MethodSummary
|
10
|
+
name: specification
|
11
|
+
- !ruby/object:RI::MethodSummary
|
12
|
+
name: specifications
|
13
|
+
comment:
|
14
|
+
constants: []
|
15
|
+
|
16
|
+
full_name: Quarry::Design
|
17
|
+
includes: []
|
18
|
+
|
19
|
+
instance_methods: []
|
20
|
+
|
21
|
+
name: Design
|
22
|
+
superclass:
|
@@ -0,0 +1,12 @@
|
|
1
|
+
--- !ruby/object:RI::MethodDescription
|
2
|
+
aliases: []
|
3
|
+
|
4
|
+
block_params:
|
5
|
+
comment:
|
6
|
+
- !ruby/struct:SM::Flow::P
|
7
|
+
body: "TODO: make output compatible with unit_diff ?"
|
8
|
+
full_name: Quarry::Design::check
|
9
|
+
is_singleton: true
|
10
|
+
name: check
|
11
|
+
params: ()
|
12
|
+
visibility: public
|
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:RI::ClassDescription
|
2
|
+
attributes:
|
3
|
+
- !ruby/object:RI::Attribute
|
4
|
+
comment:
|
5
|
+
name: decoys
|
6
|
+
rw: R
|
7
|
+
- !ruby/object:RI::Attribute
|
8
|
+
comment:
|
9
|
+
name: ducks
|
10
|
+
rw: R
|
11
|
+
class_methods:
|
12
|
+
- !ruby/object:RI::MethodSummary
|
13
|
+
name: duckcall
|
14
|
+
- !ruby/object:RI::MethodSummary
|
15
|
+
name: new
|
16
|
+
comment:
|
17
|
+
- !ruby/struct:SM::Flow::H
|
18
|
+
level: 1
|
19
|
+
text: Method Probe
|
20
|
+
- !ruby/struct:SM::Flow::P
|
21
|
+
body: Method::Probe (aka DuckHunter) is a decoy object which is dropped into methods which records the calls made against it --hence a method probe. Of course, it is not perfect --an inescapable matter it seems for any internal probe. There are a couple of issues related to conditionals. Since the method test for a certain condition against the decoy, how is the decoy to respond? Thus ceratin paths in the code may never get exceuted and thus go unmapped. If Ruby had better conditional reflection (i.e. if 'if', 'case', 'unless', 'when', etc. were true methods) then this could be fixed by making the Probe reentrant, mapping out variant true/false/nil replies. The likely insurmountable problem though is the Halting problem. A probe can cause some methods to complete execution. It's pretty rare, but it can happen and little can be done about it (I think).
|
22
|
+
- !ruby/struct:SM::Flow::P
|
23
|
+
body: Note, the alternative to this kind of probe is a program that examines, rather then executes, the code. This would circumvent the above problems, but run into difficulties with dynamic evals. It would also be more complicated, but might prove a better means in the future.
|
24
|
+
- !ruby/struct:SM::Flow::P
|
25
|
+
body: This script is provided for experimetnal purposes. Please inform the author if you find ways to improve it or put it to an interesting use.
|
26
|
+
- !ruby/struct:SM::Flow::H
|
27
|
+
level: 2
|
28
|
+
text: Synopsis
|
29
|
+
- !ruby/struct:SM::Flow::VERB
|
30
|
+
body: " require 'methodprobe'\n\n def amethod(x)\n x + 1\n end\n\n p method(:amethod).signiture\n p method(:amethod).signiture(:class)\n p method(:amethod).signiture(:pretty)\n"
|
31
|
+
- !ruby/struct:SM::Flow::P
|
32
|
+
body: produces
|
33
|
+
- !ruby/struct:SM::Flow::VERB
|
34
|
+
body: " [["+"]]\n [{"+"=>[["Fixnum"]]}]\n [["+( Fixnum )"]]\n"
|
35
|
+
constants: []
|
36
|
+
|
37
|
+
full_name: Quarry::MethodProbe
|
38
|
+
includes: []
|
39
|
+
|
40
|
+
instance_methods:
|
41
|
+
- !ruby/object:RI::MethodSummary
|
42
|
+
name: initialize_copy
|
43
|
+
- !ruby/object:RI::MethodSummary
|
44
|
+
name: method_missing
|
45
|
+
name: MethodProbe
|
46
|
+
superclass: Object
|
@@ -0,0 +1,52 @@
|
|
1
|
+
--- !ruby/object:RI::ClassDescription
|
2
|
+
attributes:
|
3
|
+
- !ruby/object:RI::Attribute
|
4
|
+
comment:
|
5
|
+
name: mocked_class
|
6
|
+
rw: R
|
7
|
+
class_methods:
|
8
|
+
- !ruby/object:RI::MethodSummary
|
9
|
+
name: echo
|
10
|
+
- !ruby/object:RI::MethodSummary
|
11
|
+
name: keys
|
12
|
+
- !ruby/object:RI::MethodSummary
|
13
|
+
name: mock
|
14
|
+
- !ruby/object:RI::MethodSummary
|
15
|
+
name: mocks
|
16
|
+
- !ruby/object:RI::MethodSummary
|
17
|
+
name: spin
|
18
|
+
comment:
|
19
|
+
- !ruby/struct:SM::Flow::H
|
20
|
+
level: 1
|
21
|
+
text: Mock Object
|
22
|
+
- !ruby/struct:SM::Flow::P
|
23
|
+
body: A straightfoward mocking facility. Typically used in test cases. The Mock class offers a few constructors for quickly building mockups.
|
24
|
+
- !ruby/struct:SM::Flow::VERB
|
25
|
+
body: " mock - Returns a static reponse.\n echo - Returns the arguments passed-in.\n spin - Returns a rotation of responses.\n keys - Returns an index of responses.\n"
|
26
|
+
- !ruby/struct:SM::Flow::P
|
27
|
+
body: Mock classes can be built from sratch or partially framed against other classes.
|
28
|
+
- !ruby/struct:SM::Flow::H
|
29
|
+
level: 3
|
30
|
+
text: Usage
|
31
|
+
- !ruby/struct:SM::Flow::VERB
|
32
|
+
body: " class ContextMock < Mock\n mock :response_headers, {}\n spin :host_url, ['http://www.nitrohq.com','http://www.rubyforge.com']\n end\n\n ctx = ContextMock.new\n ctx.response_headers['location'] = url\n ctx.host_url #=> "http://www.nitrohq.com"\n ctx.host_url #=> "http://www.rubyforge.com"\n"
|
33
|
+
- !ruby/struct:SM::Flow::P
|
34
|
+
body: Or
|
35
|
+
- !ruby/struct:SM::Flow::VERB
|
36
|
+
body: " class ContextMock < Mock(Context)\n ...\n end\n"
|
37
|
+
constants:
|
38
|
+
- !ruby/object:RI::Constant
|
39
|
+
comment:
|
40
|
+
- !ruby/struct:SM::Flow::P
|
41
|
+
body: "Certain methods are not mocked:"
|
42
|
+
- !ruby/struct:SM::Flow::VERB
|
43
|
+
body: " inspect (tricky)\n class (delegated)\n kind_of? (delegated)\n is_a? (delegated)\n instance_of? (delegated)\n method (works as-is)\n send (works as-is)\n respond_to? (works as-is)\n hash (no way to mock)\n\n <em>id</em>, <em>call</em>, etc. (not meant to be mocked, ever!)\n"
|
44
|
+
name: UnmockedMethods
|
45
|
+
value: "%r{^( |inspect |kind_of\\?|is_a\\?|instance_of\\?|class |method|send|respond_to\\? |hash |__ )}x"
|
46
|
+
full_name: Quarry::Mock::Object
|
47
|
+
includes: []
|
48
|
+
|
49
|
+
instance_methods: []
|
50
|
+
|
51
|
+
name: Object
|
52
|
+
superclass: OpenStruct
|