grumpy_old_man 0.1.0 → 0.1.1
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/Gemfile +4 -0
- data/Gemfile.lock +20 -0
- data/README.md +11 -5
- data/lib/grumpy_old_man.rb +3 -17
- metadata +6 -7
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,25 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
albino (1.3.3)
|
5
|
+
posix-spawn (>= 0.3.6)
|
6
|
+
classifier (1.3.3)
|
7
|
+
fast-stemmer (>= 1.0.0)
|
4
8
|
diff-lcs (1.1.3)
|
9
|
+
directory_watcher (1.4.1)
|
10
|
+
fast-stemmer (1.0.1)
|
11
|
+
jekyll (0.11.2)
|
12
|
+
albino (~> 1.3)
|
13
|
+
classifier (~> 1.3)
|
14
|
+
directory_watcher (~> 1.1)
|
15
|
+
kramdown (~> 0.13)
|
16
|
+
liquid (~> 2.3)
|
17
|
+
maruku (~> 0.5)
|
18
|
+
kramdown (0.13.7)
|
19
|
+
liquid (2.4.1)
|
20
|
+
maruku (0.6.0)
|
21
|
+
syntax (>= 1.0.0)
|
22
|
+
posix-spawn (0.3.6)
|
5
23
|
rspec (2.11.0)
|
6
24
|
rspec-core (~> 2.11.0)
|
7
25
|
rspec-expectations (~> 2.11.0)
|
@@ -10,9 +28,11 @@ GEM
|
|
10
28
|
rspec-expectations (2.11.2)
|
11
29
|
diff-lcs (~> 1.1.3)
|
12
30
|
rspec-mocks (2.11.2)
|
31
|
+
syntax (1.0.0)
|
13
32
|
|
14
33
|
PLATFORMS
|
15
34
|
ruby
|
16
35
|
|
17
36
|
DEPENDENCIES
|
37
|
+
jekyll
|
18
38
|
rspec
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# Grumpy Old Man
|
2
2
|
|
3
|
-
|
3
|
+
## Adding old school asserts to RSpec.
|
4
4
|
|
5
|
-

|
6
6
|
|
7
7
|
It adds the following methods to RSpec without compromising any of RSpecs awesomeness.
|
8
8
|
|
@@ -17,9 +17,9 @@ Yes you really can have your cake and eat it too!
|
|
17
17
|
I love several things about RSpec.
|
18
18
|
|
19
19
|
* Its beautiful output from the test runner
|
20
|
-
* Its declarative approach to writing tests... well at least the outer wrapper e.g. `describe Thing it 'should do stuff'`
|
20
|
+
* Its declarative approach to writing tests... well at least the outer wrapper e.g. `describe Thing; it 'should do stuff'`
|
21
21
|
|
22
|
-
I lament the fact that the rest of RSpec is an over engineered solution to a simple problem
|
22
|
+
I lament the fact that the rest of RSpec is an over engineered solution to a simple problem:
|
23
23
|
`assert true`
|
24
24
|
|
25
25
|
---
|
@@ -46,9 +46,15 @@ Asserts allow me to write code that more closely resembles the app logic itself.
|
|
46
46
|
|
47
47
|
## Usage
|
48
48
|
|
49
|
+
```bash
|
50
|
+
gem install grumpy_old_man
|
51
|
+
```
|
52
|
+
|
49
53
|
Simply include GrumpyOldMan in your spec/test like so.
|
50
54
|
|
51
55
|
```ruby
|
56
|
+
require 'grumpy_old_man'
|
57
|
+
|
52
58
|
describe Thing
|
53
59
|
include GrumpyOldMan
|
54
60
|
|
data/lib/grumpy_old_man.rb
CHANGED
@@ -1,21 +1,7 @@
|
|
1
|
-
#
|
2
|
-
# My contention is that its better to write tests in the same fashion that you write the app.
|
3
|
-
# This approach is faster since it does away with the need to context switch
|
4
|
-
# between app logic and a wonky DSL provided by the test suite.
|
5
|
-
# The barrier to entry is also lower for the unitiated RSpec user.
|
6
|
-
#
|
7
|
-
# Consider the following example from the RSpec docs.
|
8
|
-
# expect(order.total).to eq(Money.new(5.55, :USD))
|
9
|
-
#
|
10
|
-
# Rewritten with GrumpyOldMan.
|
11
|
-
# assert_equal order.total, Money.new(5.55, :USD)
|
12
|
-
#
|
13
|
-
# The traditional assert allows me to write the same style of code in both the app and my tests.
|
14
|
-
# This feels much more natural to me. You might not agree, but I'm sticking to my old fashioned assert.
|
1
|
+
# A mixin for RSpec tests that provides old school assert methods.
|
15
2
|
module GrumpyOldMan
|
16
3
|
|
17
|
-
# A simple assert for RSpec
|
18
|
-
# and monkeypatched object methods that eventually boil down to a basic "assert" anyway.
|
4
|
+
# A simple assert for RSpec.
|
19
5
|
#
|
20
6
|
# @example
|
21
7
|
# assert(true)
|
@@ -33,7 +19,7 @@ module GrumpyOldMan
|
|
33
19
|
end
|
34
20
|
|
35
21
|
# A basic assert helper that tests for Object equality.
|
36
|
-
# Tests for object equivalence rather than object identity since this is sufficient for
|
22
|
+
# Tests for object equivalence rather than object identity since this is sufficient for most tests.
|
37
23
|
#
|
38
24
|
# @param [Objecct] obj The Object to compare.
|
39
25
|
# @param [Objecct] expected The expected value.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grumpy_old_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,10 +11,9 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: !
|
15
|
-
|
16
|
-
|
17
|
-
in your test suite?\n Welcome home my friend, GrumpyOldMan is for you.\n"
|
14
|
+
description: ! ' Provides old school assert methods for your RSpec tests.
|
15
|
+
|
16
|
+
'
|
18
17
|
email:
|
19
18
|
- natehop@gmail.com
|
20
19
|
executables: []
|
@@ -26,7 +25,7 @@ files:
|
|
26
25
|
- Gemfile.lock
|
27
26
|
- README.md
|
28
27
|
- spec/grumpy_old_man_spec.rb
|
29
|
-
homepage:
|
28
|
+
homepage: http://hopsoft.github.com/grumpy_old_man/
|
30
29
|
licenses:
|
31
30
|
- MIT
|
32
31
|
post_install_message:
|
@@ -50,5 +49,5 @@ rubyforge_project:
|
|
50
49
|
rubygems_version: 1.8.24
|
51
50
|
signing_key:
|
52
51
|
specification_version: 3
|
53
|
-
summary: Asserts for RSpec
|
52
|
+
summary: Asserts for RSpec
|
54
53
|
test_files: []
|