aboutsummaryrefslogtreecommitdiffstats
path: root/doc/CONVENTIONS
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 13:47:06 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 13:47:06 -0700
commit42c42bfa50876b4221c024cebc47fc34fc6530a9 (patch)
tree73777a9c4f61330bd89832b312318ffb555afaca /doc/CONVENTIONS
parent89b354bf97d0a981376d36f2f8a7ba6a87fe2aa8 (diff)
downloadrails-42c42bfa50876b4221c024cebc47fc34fc6530a9.tar.gz
rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.tar.bz2
rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.zip
moved bind to factory of select
Diffstat (limited to 'doc/CONVENTIONS')
-rw-r--r--doc/CONVENTIONS17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/CONVENTIONS b/doc/CONVENTIONS
new file mode 100644
index 0000000000..0d7c1b4ef0
--- /dev/null
+++ b/doc/CONVENTIONS
@@ -0,0 +1,17 @@
+This file should ultimately be replaced by a series of tests, something like a lint tool.
+
+- all describes and its should use single quotes unless they have nested quotes.
+- object instantiation in tests for all objects that are not the SUT should be manufactured in a before
+- 'should' and other counterfactuals/subjunctive forms should not be used in tests
+- no doubles should be used except for behaviorist testing
+ - behaviorist testing is desirable only when interacting with the database or the session
+- when unit testing, always demonstrate behavior by using a real world example (as in, a public use of the API), so as to provide documentation.
+- use collect rather than map
+- jargon:
+ - 'obtains' is preferred to 'returns true'
+ - 'manufactures'
+- in tests
+ - when manufacturing expected values (right-hand-side of should), avoid convenience methods -- construct it by initializing the object directly (Foo.new(...)). This ensures equality expectations in tests is rigorous.
+ - the SUT should be manufactured inline inside the test, not in a before
+ - dependencies for the SUT should be manufactured using convenience methods (or whatever is most terse).
+- group conceptually related methods in a class within an inline module; immediately include that module. \ No newline at end of file