grumpy_old_man 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/grumpy_old_man/version.rb +3 -0
- metadata +55 -18
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -38
- data/README.md +0 -81
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 38e606a4fac18ced83914f80500e576c08b953ab
|
4
|
+
data.tar.gz: 71343d0148c8cb6ab1793894487e95c9dc8b6b27
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d2526f046bb5b7bbef603bb6c515778aab4710bfea5940ff61f6199a4eb4492be46d2240782c0d591059045b1374e90fb4acc7fac8bebd04118dd0f98740993
|
7
|
+
data.tar.gz: 9f935ae2a6b5f43d370ec4b11148fef62a6205b26cc219d9b361b72d023000885894b8ec4d512bc45540cdf38d5df9e503d7de9736dfd7271940f6fc23ac0567
|
metadata
CHANGED
@@ -1,19 +1,58 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grumpy_old_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nathan Hopkins
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
date: 2014-02-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Asserts for RSpec
|
17
56
|
email:
|
18
57
|
- natehop@gmail.com
|
19
58
|
executables: []
|
@@ -21,33 +60,31 @@ extensions: []
|
|
21
60
|
extra_rdoc_files: []
|
22
61
|
files:
|
23
62
|
- lib/grumpy_old_man.rb
|
24
|
-
-
|
25
|
-
- Gemfile.lock
|
26
|
-
- README.md
|
63
|
+
- lib/grumpy_old_man/version.rb
|
27
64
|
- spec/grumpy_old_man_spec.rb
|
28
|
-
homepage:
|
65
|
+
homepage: https://github.com/hopsoft/grumpy_old_man
|
29
66
|
licenses:
|
30
67
|
- MIT
|
68
|
+
metadata: {}
|
31
69
|
post_install_message:
|
32
70
|
rdoc_options: []
|
33
71
|
require_paths:
|
34
72
|
- lib
|
35
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
74
|
requirements:
|
38
|
-
- -
|
75
|
+
- - ">="
|
39
76
|
- !ruby/object:Gem::Version
|
40
77
|
version: '0'
|
41
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
79
|
requirements:
|
44
|
-
- -
|
80
|
+
- - ">="
|
45
81
|
- !ruby/object:Gem::Version
|
46
82
|
version: '0'
|
47
83
|
requirements: []
|
48
84
|
rubyforge_project:
|
49
|
-
rubygems_version:
|
85
|
+
rubygems_version: 2.2.0
|
50
86
|
signing_key:
|
51
|
-
specification_version:
|
87
|
+
specification_version: 4
|
52
88
|
summary: Asserts for RSpec
|
53
|
-
test_files:
|
89
|
+
test_files:
|
90
|
+
- spec/grumpy_old_man_spec.rb
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
albino (1.3.3)
|
5
|
-
posix-spawn (>= 0.3.6)
|
6
|
-
classifier (1.3.3)
|
7
|
-
fast-stemmer (>= 1.0.0)
|
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)
|
23
|
-
rspec (2.11.0)
|
24
|
-
rspec-core (~> 2.11.0)
|
25
|
-
rspec-expectations (~> 2.11.0)
|
26
|
-
rspec-mocks (~> 2.11.0)
|
27
|
-
rspec-core (2.11.1)
|
28
|
-
rspec-expectations (2.11.2)
|
29
|
-
diff-lcs (~> 1.1.3)
|
30
|
-
rspec-mocks (2.11.2)
|
31
|
-
syntax (1.0.0)
|
32
|
-
|
33
|
-
PLATFORMS
|
34
|
-
ruby
|
35
|
-
|
36
|
-
DEPENDENCIES
|
37
|
-
jekyll
|
38
|
-
rspec
|
data/README.md
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
# Grumpy Old Man
|
2
|
-
|
3
|
-
## Adding old school asserts to RSpec
|
4
|
-
|
5
|
-
![GrumpyOldMan GEM](http://hopsoft.github.com/grumpy_old_man/images/clint-eastwood.jpg)
|
6
|
-
|
7
|
-
#### Do you feel lucky? ... punk.
|
8
|
-
|
9
|
-
GrumpyOldMan adds the following methods to RSpec without compromising any of RSpecs awesomeness.
|
10
|
-
|
11
|
-
* `assert`
|
12
|
-
* `assert_equal`
|
13
|
-
* `assert_raise`
|
14
|
-
|
15
|
-
Yes you really can have your cake and eat it too!
|
16
|
-
|
17
|
-
---
|
18
|
-
|
19
|
-
I love several things about RSpec.
|
20
|
-
|
21
|
-
* Its beautiful output from the test runner
|
22
|
-
* Its declarative approach to writing tests... well at least the outer wrapper e.g. `describe Thing; it 'should do stuff'`
|
23
|
-
|
24
|
-
Unfortunately parts of RSpec are over engineered and add unwanted complexity to a relatively simple problem:
|
25
|
-
`assert true`
|
26
|
-
|
27
|
-
---
|
28
|
-
|
29
|
-
My contention is that its better to write tests in the same manner you write the app.
|
30
|
-
This approach does away with the context switching between app syntax and a wonky DSL confined to the test suite.
|
31
|
-
|
32
|
-
It also lowers the barrier to entry.
|
33
|
-
|
34
|
-
Consider the following example from the RSpec docs.
|
35
|
-
|
36
|
-
```ruby
|
37
|
-
expect(order.total).to eq(Money.new(5.55, :USD))
|
38
|
-
```
|
39
|
-
|
40
|
-
Rewritten with GrumpyOldMan.
|
41
|
-
```ruby
|
42
|
-
assert order.total == Money.new(5.55, :USD)
|
43
|
-
# or ...
|
44
|
-
assert_equal order.total, Money.new(5.55, :USD)
|
45
|
-
```
|
46
|
-
|
47
|
-
Asserts allow me to write code that more closely resembles the app logic itself... which feels more natural.
|
48
|
-
|
49
|
-
## Usage
|
50
|
-
|
51
|
-
```bash
|
52
|
-
gem install grumpy_old_man
|
53
|
-
```
|
54
|
-
|
55
|
-
Simply include GrumpyOldMan in your spec/test like so.
|
56
|
-
|
57
|
-
```ruby
|
58
|
-
require 'grumpy_old_man'
|
59
|
-
|
60
|
-
describe Thing
|
61
|
-
include GrumpyOldMan
|
62
|
-
|
63
|
-
it "should feel good" do
|
64
|
-
assert true
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should be balanced" do
|
68
|
-
assert_equal true, true
|
69
|
-
end
|
70
|
-
|
71
|
-
it "should be exceptional" do
|
72
|
-
assert_raise(Exception) { raise }
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
```
|
77
|
-
|
78
|
-
You might not agree, but I'm sticking with my old fashioned assert.
|
79
|
-
|
80
|
-
**Now get off my lawn!**
|
81
|
-
|