pretentious 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +22 -12
- data/lib/pretentious/version.rb +1 -1
- data/pretentious.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c540e7a1a93193e951dbd73f85dd6ef78f2657a9
|
4
|
+
data.tar.gz: 51818210e6346db9ac4c30f549ca586cefeeb40e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4812956f222bd0b479bc5721ad88dc66e1ab38f3f4879938824354f868010ba4b34bf8a261f1e23469ab2cd2534b9dd3df1b0bafdaf54310e25930205a2da2f
|
7
|
+
data.tar.gz: 2799fde8fdb2c36a929612ff94e642ae5986d83dd8fd77f76173b67dcb8c9513e2381daa5b2a45bdb568a7b4ef2754cefa567c9cda6b435f644076491683813c
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# Ruby::Pretentious
|
2
2
|
|
3
|
-
Do you have a pretentious boss or
|
4
|
-
here is a gem to deal with that. Now you CAN write code first and then GENERATE tests later!! Yes you heard that
|
5
|
-
right!
|
6
|
-
you've written!
|
3
|
+
Do you have a pretentious boss or development lead that pushes you to embrace BDD/TDD but for reasons hate it or them?
|
4
|
+
here is a gem to deal with that. Now you CAN write your code first and then GENERATE tests later!! Yes you heard that
|
5
|
+
right! To repeat, this gem allows you to write your code first and then automatically generate tests using the code
|
6
|
+
you've written in a straightfoward manner!
|
7
7
|
|
8
8
|
On a serious note, this gem allows you to generate tests template much better than those generated by default
|
9
|
-
for various frameworks.
|
9
|
+
for various frameworks. It is also useful for "recording" current behavior of existing components in order
|
10
|
+
to prepare for refactoring.
|
10
11
|
|
11
12
|
## Installation
|
12
13
|
|
@@ -46,8 +47,8 @@ class Fibonacci
|
|
46
47
|
end
|
47
48
|
```
|
48
49
|
|
49
|
-
Inside a Pretentious.spec_for(...) block. Just write boring code that
|
50
|
-
how you'd normally use them. Finally Specify the classes that you want to test:
|
50
|
+
Inside a Pretentious.spec_for(...) block. Just write boring code that instantiates an object as well as calls the methods
|
51
|
+
like how you'd normally use them. Finally Specify the classes that you want to test:
|
51
52
|
|
52
53
|
```ruby
|
53
54
|
class Fibonacci
|
@@ -85,8 +86,8 @@ Save your file and then switch to the terminal to invoke:
|
|
85
86
|
|
86
87
|
This will automatically generate rspec tests for Fibonacci under spec of the current working directory.
|
87
88
|
|
88
|
-
|
89
|
-
put the necessary requires and definitions there.
|
89
|
+
You can actually invoke rspec at this point, but the tests will fail. Before you do that you should edit
|
90
|
+
spec/spec_helper.rb and put the necessary requires and definitions there.
|
90
91
|
|
91
92
|
For this example place the following into spec_helper.rb:
|
92
93
|
|
@@ -138,16 +139,25 @@ RSpec.describe Digest::MD5 do
|
|
138
139
|
end
|
139
140
|
```
|
140
141
|
|
141
|
-
Only RSpec is
|
142
|
+
Only RSpec is supported at this point. But other testing frameworks should be trivial to add support to.
|
143
|
+
|
144
|
+
## Things to do after
|
145
|
+
|
146
|
+
Since your tests are already written, and hopefully nobody notices its written by a machine, you may just leave it
|
147
|
+
at that. Take note of the limitations though.
|
148
|
+
|
149
|
+
But if lest your conscience suffers, it is best to go back to the specs and refine them, add more tests and behave like
|
150
|
+
a bdd'er/tdd'er.
|
142
151
|
|
143
152
|
## Limitations
|
144
153
|
|
145
154
|
Computers are bad at mind reading (for now) and they don't really know your expectation of "correctness", as such
|
146
155
|
it assumes your code is correct and can only use equality based matchers. It can also only reliably match
|
147
|
-
primitive data types and hashs and arrays to degree. More complex expectations are unfortunately left for the
|
156
|
+
primitive data types and hashs and arrays to a degree. More complex expectations are unfortunately left for the humans
|
157
|
+
to resolve.
|
148
158
|
|
149
159
|
Also do note that it tries its best to determine how your fixtures are created, as well as the types
|
150
|
-
of your parameters and does so by figuring out the components that your object needs. Failure can happen during this process.
|
160
|
+
of your parameters and does so by figuring out (recursively) the components that your object needs. Failure can happen during this process.
|
151
161
|
|
152
162
|
Finally, Limit this gem for test environments only.
|
153
163
|
|
data/lib/pretentious/version.rb
CHANGED
data/pretentious.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Pretentious::VERSION
|
9
9
|
spec.authors = ["Joseph Emmanuel Dayo"]
|
10
10
|
spec.email = ["joseph.dayo@gmail.com"]
|
11
|
-
spec.summary = %q{
|
11
|
+
spec.summary = %q{Generate tests from existing code as well as a way to deal with pretentious TDD/BDD developers}
|
12
12
|
spec.description = %q{Do you have a pretentious boss or dev lead that pushes you to embrace tdd but for reasons hate it or them? here is a gem to deal with that.}
|
13
13
|
spec.homepage = "https://github.com/jedld/pretentious"
|
14
14
|
spec.license = "MIT"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretentious
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Emmanuel Dayo
|
@@ -105,7 +105,8 @@ rubyforge_project:
|
|
105
105
|
rubygems_version: 2.2.2
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
|
-
summary:
|
108
|
+
summary: Generate tests from existing code as well as a way to deal with pretentious
|
109
|
+
TDD/BDD developers
|
109
110
|
test_files:
|
110
111
|
- spec/fibonacci_spec.rb
|
111
112
|
- spec/m_d5_spec.rb
|