grumpy_old_man 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/loc +3 -0
- data/bin/standardize +4 -0
- data/lib/grumpy_old_man.rb +22 -12
- data/lib/grumpy_old_man/version.rb +3 -1
- data/spec/grumpy_old_man_spec.rb +8 -4
- metadata +54 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3dc784fc304a28b294ad90e649b5bcd3d71bed378a0dd8559f21163b0555a2d6
|
4
|
+
data.tar.gz: 44e54ab83d9dd0f3dc92bf8eb45a009d107f5928264ce436a12b8fe5fb6cdbcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9dfc1a3c1d10825ce035978773137faa080dea9edbd11ad10f883ed5f9207a61636a4a4adc374e039a7288d20ebf3b9573909536d8ffaa62601808e7fc085c8
|
7
|
+
data.tar.gz: 57a184758e4b5cbe038c98ddb83a76ff5a40e0f9ee6b6e0460c6b0667f47abf61b51281b1a1e802efd25e4565ace91b116e2a2af1c957f2c9aa59c2ebef5d511
|
data/bin/loc
ADDED
data/bin/standardize
ADDED
data/lib/grumpy_old_man.rb
CHANGED
@@ -1,23 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "grumpy_old_man/version"
|
2
4
|
|
3
5
|
# A mixin for RSpec tests that provides old school assert methods.
|
4
6
|
module GrumpyOldMan
|
5
|
-
|
6
7
|
# A simple assert for RSpec.
|
7
8
|
#
|
8
9
|
# @example
|
9
|
-
# assert
|
10
|
+
# assert true
|
10
11
|
#
|
11
12
|
# @example
|
12
13
|
# assert { true.to_s == "true" }
|
13
14
|
#
|
14
15
|
# @param [Object] arg An optional arg to assert as equal to true.
|
15
|
-
def assert(arg=nil)
|
16
|
-
if block_given?
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
def assert(arg = nil)
|
17
|
+
arg = yield if block_given?
|
18
|
+
assert_equal !!arg, true
|
19
|
+
end
|
20
|
+
|
21
|
+
# A simple refute for RSpec.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# refute false
|
25
|
+
#
|
26
|
+
# @example
|
27
|
+
# refute { false.to_s == "true" }
|
28
|
+
#
|
29
|
+
# @param [Object] arg An optional arg to assert as equal to true.
|
30
|
+
def refute(arg = nil)
|
31
|
+
arg = yield if block_given?
|
32
|
+
assert_equal !!arg, false
|
21
33
|
end
|
22
34
|
|
23
35
|
# A basic assert helper that tests for Object equality.
|
@@ -26,14 +38,12 @@ module GrumpyOldMan
|
|
26
38
|
# @param [Object] actual The Object to compare.
|
27
39
|
# @param [Object] expected The expected value.
|
28
40
|
def assert_equal(actual, expected)
|
29
|
-
|
41
|
+
expect(actual).to eql(expected)
|
30
42
|
end
|
31
43
|
|
32
44
|
# A basic assert helper that ensures an Error was raised.
|
33
45
|
# @param [Class] ex The expected Exception class.
|
34
46
|
def assert_raise(ex, &block)
|
35
|
-
Proc.new(&block).
|
47
|
+
expect(Proc.new(&block)).to raise_error(ex)
|
36
48
|
end
|
37
|
-
|
38
49
|
end
|
39
|
-
|
data/spec/grumpy_old_man_spec.rb
CHANGED
@@ -1,19 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require File.expand_path("../../lib/grumpy_old_man", __FILE__)
|
2
4
|
|
3
5
|
describe RSpec do
|
4
6
|
include GrumpyOldMan
|
5
7
|
|
6
8
|
it "should support assert with GrumpyOldMan" do
|
7
|
-
assert
|
9
|
+
assert true
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should support refute with GrumpyOldMan" do
|
13
|
+
refute false
|
8
14
|
end
|
9
15
|
|
10
16
|
it "should support assert_equal with GrumpyOldMan" do
|
11
|
-
assert_equal
|
17
|
+
assert_equal true, true
|
12
18
|
end
|
13
19
|
|
14
20
|
it "should support assert_raise with GrumpyOldMan" do
|
15
|
-
assert self.respond_to?(:assert_raise)
|
16
21
|
assert_raise(Exception) { raise }
|
17
22
|
end
|
18
23
|
end
|
19
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -28,16 +28,44 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: magic_frozen_string_literal
|
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
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: rake
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +80,20 @@ dependencies:
|
|
52
80
|
- - ">="
|
53
81
|
- !ruby/object:Gem::Version
|
54
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: standard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
description: Asserts for RSpec
|
56
98
|
email:
|
57
99
|
- natehop@gmail.com
|
@@ -59,6 +101,8 @@ executables: []
|
|
59
101
|
extensions: []
|
60
102
|
extra_rdoc_files: []
|
61
103
|
files:
|
104
|
+
- bin/loc
|
105
|
+
- bin/standardize
|
62
106
|
- lib/grumpy_old_man.rb
|
63
107
|
- lib/grumpy_old_man/version.rb
|
64
108
|
- spec/grumpy_old_man_spec.rb
|
@@ -66,7 +110,7 @@ homepage: https://github.com/hopsoft/grumpy_old_man
|
|
66
110
|
licenses:
|
67
111
|
- MIT
|
68
112
|
metadata: {}
|
69
|
-
post_install_message:
|
113
|
+
post_install_message:
|
70
114
|
rdoc_options: []
|
71
115
|
require_paths:
|
72
116
|
- lib
|
@@ -81,9 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
125
|
- !ruby/object:Gem::Version
|
82
126
|
version: '0'
|
83
127
|
requirements: []
|
84
|
-
|
85
|
-
|
86
|
-
signing_key:
|
128
|
+
rubygems_version: 3.2.15
|
129
|
+
signing_key:
|
87
130
|
specification_version: 4
|
88
131
|
summary: Asserts for RSpec
|
89
132
|
test_files:
|