uspec 0.2.1 → 0.2.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/.rubocop.yml +56 -0
- data/README.markdown +3 -2
- data/lib/uspec/dsl.rb +1 -1
- data/lib/uspec/result.rb +3 -1
- data/lib/uspec/version.rb +1 -1
- data/uspec/result_spec.rb +2 -2
- data/uspec/uspec_spec.rb +10 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62e31cb81d9310131f0336f4a946e8adbb499cf36864a83d76eaf0054821dff0
|
|
4
|
+
data.tar.gz: c91492ba7e80c49e9781af2ce08f5396e269d0f41148c61d682d1d89a603f71d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0c3a167ad68a9ca32439346761a1520360bf84c52097cf0ed1356b7569c810581d261e65a0b22fae4201415e2e517b589ac6f6dc5c6b95747e41d7dae2f3211
|
|
7
|
+
data.tar.gz: 7b8e868bf9d42b008f9b5ee5fc8aea44b557c9d59e7021a500dcf1a08c4ec30a7316c0c6fdaa498ae02fab84b498707f7ce6036fc424b9cc6eba6967ca5eefa9
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Rubocop override settings
|
|
2
|
+
|
|
3
|
+
AllCops:
|
|
4
|
+
TargetRubyVersion: 2.0
|
|
5
|
+
|
|
6
|
+
Metrics/LineLength:
|
|
7
|
+
Max: 120
|
|
8
|
+
Exclude:
|
|
9
|
+
- config_module.gemspec
|
|
10
|
+
- "uspec/**/*"
|
|
11
|
+
|
|
12
|
+
Naming/PredicateName:
|
|
13
|
+
Enabled: false
|
|
14
|
+
|
|
15
|
+
Style/PreferredHashMethods:
|
|
16
|
+
Exclude:
|
|
17
|
+
- "**/*"
|
|
18
|
+
|
|
19
|
+
Style/Documentation:
|
|
20
|
+
Enabled: false
|
|
21
|
+
|
|
22
|
+
Style/MethodDefParentheses:
|
|
23
|
+
Enabled: false
|
|
24
|
+
|
|
25
|
+
Style/ParallelAssignment:
|
|
26
|
+
Enabled: false
|
|
27
|
+
|
|
28
|
+
Style/SingleLineMethods:
|
|
29
|
+
Enabled: false
|
|
30
|
+
|
|
31
|
+
Style/Alias:
|
|
32
|
+
Enabled: false
|
|
33
|
+
|
|
34
|
+
Style/CaseEquality:
|
|
35
|
+
Enabled: false
|
|
36
|
+
|
|
37
|
+
Style/SymbolArray:
|
|
38
|
+
Enabled: false
|
|
39
|
+
|
|
40
|
+
Bundler/OrderedGems:
|
|
41
|
+
Enabled: false
|
|
42
|
+
|
|
43
|
+
Style/StringLiterals:
|
|
44
|
+
EnforcedStyle: double_quotes
|
|
45
|
+
|
|
46
|
+
Style/StringLiteralsInInterpolation:
|
|
47
|
+
EnforcedStyle: double_quotes
|
|
48
|
+
|
|
49
|
+
Layout/AccessModifierIndentation:
|
|
50
|
+
EnforcedStyle: outdent
|
|
51
|
+
|
|
52
|
+
Style/EnforcedStyleForMultiline:
|
|
53
|
+
EnforcedStyle: consistent_comma
|
|
54
|
+
|
|
55
|
+
Naming/RescuedExceptionsVariableName:
|
|
56
|
+
PreferredName: error
|
data/README.markdown
CHANGED
|
@@ -3,8 +3,9 @@ Uspec
|
|
|
3
3
|
|
|
4
4
|
Uspec is a shiny little testing framework for your apps!
|
|
5
5
|
|
|
6
|
-
[](https://rubygems.org/gems/uspec/)
|
|
7
|
+
[](https://travis-ci.org/acook/uspec)
|
|
8
|
+
[](https://codeclimate.com/github/acook/uspec)
|
|
8
9
|
|
|
9
10
|
Philosophy / Why Uspec?
|
|
10
11
|
-----------------------
|
data/lib/uspec/dsl.rb
CHANGED
data/lib/uspec/result.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require_relative "terminal"
|
|
2
|
+
require "toisb"
|
|
2
3
|
|
|
3
4
|
module Uspec
|
|
4
5
|
class Result
|
|
@@ -8,8 +9,9 @@ module Uspec
|
|
|
8
9
|
@spec = spec
|
|
9
10
|
@raw = raw
|
|
10
11
|
@source = source
|
|
12
|
+
@handler = ::TOISB.wrap raw
|
|
11
13
|
end
|
|
12
|
-
attr_reader :spec, :raw, :source
|
|
14
|
+
attr_reader :spec, :raw, :source, :handler
|
|
13
15
|
|
|
14
16
|
def pretty
|
|
15
17
|
if raw == true then
|
data/lib/uspec/version.rb
CHANGED
data/uspec/result_spec.rb
CHANGED
|
@@ -29,12 +29,12 @@ spec "ensure parent object of BasicObject subclasses get a useful error message"
|
|
|
29
29
|
actual.include?(expected) || result.inspector
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
class ::InspectFail; def inspect; raise; end; end
|
|
32
|
+
class ::InspectFail; def inspect; raise RuntimeError, "This error is intentional and part of the test."; end; end
|
|
33
33
|
inspect_fail = InspectFail.new
|
|
34
34
|
|
|
35
35
|
spec "display a useful error message when a user-defined inspect method fails" do
|
|
36
36
|
result = Uspec::Result.new "Inspect Fail Result", inspect_fail, []
|
|
37
|
-
expected = "raises an
|
|
37
|
+
expected = "raises an exception"
|
|
38
38
|
actual = result.pretty
|
|
39
39
|
actual.include?(expected) || result.inspector
|
|
40
40
|
end
|
data/uspec/uspec_spec.rb
CHANGED
|
@@ -10,6 +10,16 @@ spec 'catches errors' do
|
|
|
10
10
|
output.include? 'Exception'
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
spec 'catches even non-StandardError-subclass exceptions' do
|
|
14
|
+
output = capture do
|
|
15
|
+
spec 'not implemented error' do
|
|
16
|
+
raise ::NotImplementedError, 'test exception'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
output.include? 'Exception'
|
|
21
|
+
end
|
|
22
|
+
|
|
13
23
|
spec 'complains when spec block returns non boolean' do
|
|
14
24
|
output = capture do
|
|
15
25
|
spec 'whatever' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anthony M. Cook
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pry
|
|
@@ -50,6 +50,7 @@ extra_rdoc_files: []
|
|
|
50
50
|
files:
|
|
51
51
|
- ".editorconfig"
|
|
52
52
|
- ".gitignore"
|
|
53
|
+
- ".rubocop.yml"
|
|
53
54
|
- ".ruby-gemset"
|
|
54
55
|
- ".ruby-version"
|
|
55
56
|
- ".travis.yml"
|