pry-test 0.6.1 → 0.6.6
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 +5 -5
- data/bin/pry-test +1 -1
- data/bin/standardize +4 -0
- data/lib/pry-test.rb +3 -1
- data/lib/pry-test/formatters/base_formatter.rb +5 -5
- data/lib/pry-test/formatters/color.rb +11 -9
- data/lib/pry-test/formatters/default_async_formatter.rb +2 -1
- data/lib/pry-test/formatters/default_formatter.rb +2 -1
- data/lib/pry-test/formatters/template.rb +8 -7
- data/lib/pry-test/runner.rb +10 -11
- data/lib/pry-test/test.rb +4 -19
- data/lib/pry-test/test_wrapper.rb +57 -30
- data/lib/pry-test/version.rb +3 -1
- data/test/color_test.rb +2 -1
- data/test/demos/fail_test.rb +2 -2
- data/test/demos/io_latency_test.rb +2 -2
- data/test/runner_test.rb +4 -1
- data/test/test_helper.rb +2 -0
- data/test/test_test.rb +17 -23
- data/test/test_wrapper_test.rb +9 -1
- metadata +43 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 49293b2860beb82dfddce98173d8b6d4c88a4496742521459d96af1b8f0ebefa
|
4
|
+
data.tar.gz: 5ed5052aad02cb367a5344918e2f37d8540e5e6ec61397ff1d1b90c67a5aa9ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e136ed442f5914bbf00b44a5c9c093e7d6f0dae93693f6e8fd3cd89cd37546f84bec244eae1cd938039d44a4ee9968548d6fbccaf751f00bb19d0576607e4bb
|
7
|
+
data.tar.gz: e7eac236789f34cfa2dcf056283262d5dfd3df9ff81ee184b90fb66a68d1c703d7eccd07e3bc68d040f0dd1129bd4b154c31143d934b8f239344016847f32f90
|
data/bin/pry-test
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "optparse"
|
4
|
+
require_relative "../lib/pry-test"
|
4
5
|
|
5
6
|
# setup the options -----------------------------------------------------------
|
6
7
|
options = {}
|
@@ -80,7 +81,6 @@ if ENV["PRY_TEST_COVERAGE"]
|
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
83
|
-
require_relative "../lib/pry-test"
|
84
84
|
require_tests options
|
85
85
|
include PryTest::Color
|
86
86
|
|
data/bin/standardize
ADDED
data/lib/pry-test.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
module PryTest
|
3
4
|
class << self
|
4
5
|
def formatters
|
5
6
|
@formatters ||= []
|
@@ -56,19 +57,18 @@ module PryTest
|
|
56
57
|
def after_suite(test_classes)
|
57
58
|
end
|
58
59
|
|
59
|
-
def render(template_name, template_context=nil)
|
60
|
+
def render(template_name, template_context = nil)
|
60
61
|
puts text_to_render(template_name, template_context)
|
61
62
|
end
|
62
63
|
|
63
|
-
def render_inline(template_name, template_context=nil)
|
64
|
+
def render_inline(template_name, template_context = nil)
|
64
65
|
print text_to_render(template_name, template_context)
|
65
66
|
end
|
66
67
|
|
67
68
|
private
|
68
69
|
|
69
|
-
def text_to_render(template_name, template_context=nil)
|
70
|
+
def text_to_render(template_name, template_context = nil)
|
70
71
|
Template.new(template_context || self).render_to_string(template_name)
|
71
72
|
end
|
72
|
-
|
73
73
|
end
|
74
74
|
end
|
@@ -1,16 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PryTest
|
2
4
|
module Color
|
3
5
|
extend self
|
4
6
|
|
5
7
|
colors = {
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
8
|
+
red: 31,
|
9
|
+
green: 32,
|
10
|
+
yellow: 33,
|
11
|
+
blue: 34,
|
12
|
+
magenta: 35,
|
13
|
+
cyan: 36,
|
14
|
+
white: 37,
|
15
|
+
gray: 90
|
14
16
|
}
|
15
17
|
|
16
18
|
def default(text)
|
@@ -19,7 +21,7 @@ module PryTest
|
|
19
21
|
|
20
22
|
colors.each do |name, code|
|
21
23
|
define_method name do |text|
|
22
|
-
|
24
|
+
"\e[#{code}m#{text}\e[0m"
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "erb"
|
2
4
|
require_relative "color"
|
3
5
|
|
@@ -16,15 +18,15 @@ module PryTest
|
|
16
18
|
|
17
19
|
def render_to_string(name)
|
18
20
|
instance_eval do
|
19
|
-
ERB.new(self.class.view(name),
|
21
|
+
ERB.new(self.class.view(name), trim_mode: "-").result(binding)
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
23
25
|
def partial(name, *collection)
|
24
26
|
return render_to_string(name) if collection.empty?
|
25
|
-
collection.map
|
27
|
+
collection.map { |item|
|
26
28
|
Template.new(item).render_to_string(name)
|
27
|
-
|
29
|
+
}.join("\n")
|
28
30
|
end
|
29
31
|
|
30
32
|
def duration_color(duration)
|
@@ -40,12 +42,11 @@ module PryTest
|
|
40
42
|
finish = assert[:lines].length - 1 if finish >= assert[:lines].length
|
41
43
|
(start..finish).map do |i|
|
42
44
|
{
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
45
|
+
line_num: (i + 1),
|
46
|
+
line: assert[:lines][i],
|
47
|
+
color: (i == index ? :red : :gray)
|
46
48
|
}
|
47
49
|
end
|
48
50
|
end
|
49
|
-
|
50
51
|
end
|
51
52
|
end
|
data/lib/pry-test/runner.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
require "thread"
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
3
|
+
require "os"
|
4
4
|
module PryTest
|
5
5
|
class Runner
|
6
6
|
class << self
|
@@ -13,9 +13,9 @@ module PryTest
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
attr_reader :formatter, :options, :duration
|
16
|
+
attr_reader :formatter, :options, :duration
|
17
17
|
|
18
|
-
def initialize(formatter, options={})
|
18
|
+
def initialize(formatter, options = {})
|
19
19
|
@formatter = formatter
|
20
20
|
@options = options
|
21
21
|
end
|
@@ -32,11 +32,11 @@ module PryTest
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def tests
|
35
|
-
@tests ||= test_classes.map{ |klass| klass.tests }.flatten
|
35
|
+
@tests ||= test_classes.map { |klass| klass.tests }.flatten
|
36
36
|
end
|
37
37
|
|
38
38
|
def failed_tests
|
39
|
-
tests.select{ |test| test.invoked? && !test.passed? }
|
39
|
+
tests.select { |test| test.invoked? && !test.passed? }
|
40
40
|
end
|
41
41
|
|
42
42
|
def failed
|
@@ -44,7 +44,7 @@ module PryTest
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def passed_tests
|
47
|
-
tests.select{ |test| test.invoked? && test.passed? }
|
47
|
+
tests.select { |test| test.invoked? && test.passed? }
|
48
48
|
end
|
49
49
|
|
50
50
|
def passed
|
@@ -84,17 +84,16 @@ module PryTest
|
|
84
84
|
|
85
85
|
def run_threads(queue)
|
86
86
|
puts "PryTest is running #{thread_count} threads."
|
87
|
-
threads = thread_count.times.map
|
87
|
+
threads = thread_count.times.map {
|
88
88
|
Thread.new do
|
89
|
-
|
89
|
+
until queue.empty?
|
90
90
|
Thread.current.terminate if PryTest::Runner.terminate?
|
91
91
|
test = queue.pop
|
92
92
|
test.invoke(formatter, options)
|
93
93
|
end
|
94
94
|
end
|
95
|
-
|
95
|
+
}
|
96
96
|
threads.each { |t| t.join }
|
97
97
|
end
|
98
|
-
|
99
98
|
end
|
100
99
|
end
|
data/lib/pry-test/test.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
module PryTest
|
3
4
|
# Superclass for all test classes.
|
4
5
|
# @example Create a subclass with a test.
|
5
6
|
# class SimpleTest < PryTest::Test
|
@@ -9,7 +10,6 @@ module PryTest
|
|
9
10
|
# end
|
10
11
|
class Test
|
11
12
|
class << self
|
12
|
-
|
13
13
|
# All subclasses of this class.
|
14
14
|
# @return [Array<PryTest::Test>]
|
15
15
|
def subclasses
|
@@ -22,36 +22,22 @@ module PryTest
|
|
22
22
|
@tests ||= []
|
23
23
|
end
|
24
24
|
|
25
|
-
# All files that define subclasses of this class.
|
26
|
-
# @note Primarily used in the context of PryTest::Test.
|
27
|
-
# @example Files are stored in a Hash with the following format.
|
28
|
-
# {
|
29
|
-
# "path/to/file1.rb" => ["line 1", "line 2", "line 3", ...],
|
30
|
-
# "path/to/file2.rb" => ["line 1", "line 2", "line 3", ...]
|
31
|
-
# }
|
32
|
-
# @return [Hash]
|
33
|
-
def files
|
34
|
-
@files ||= {}
|
35
|
-
end
|
36
|
-
|
37
25
|
# A callback provided by Ruby that is invoked whenever a subclass is created.
|
38
26
|
def inherited(subclass)
|
39
|
-
file_path = caller[0][0, caller[0].index(/:[0-9]+:/)]
|
40
|
-
files[file_path] = File.open(file_path).readlines
|
41
27
|
subclasses << subclass
|
42
28
|
end
|
43
29
|
|
44
30
|
# Defines a setup method that will run before each individual test.
|
45
31
|
# @param [Symbol] what Deprecated but maintained for backwards compatibility.
|
46
32
|
# @yield A block of code that will serve as the setup method.
|
47
|
-
def before(what=nil, &block)
|
33
|
+
def before(what = nil, &block)
|
48
34
|
@before = block
|
49
35
|
end
|
50
36
|
|
51
37
|
# Defines a teardown method that will run after each individual test.
|
52
38
|
# @param [Symbol] what Deprecated but maintained for backwards compatibility.
|
53
39
|
# @yield A block of code that will serve as the teardown method.
|
54
|
-
def after(what=nil, &block)
|
40
|
+
def after(what = nil, &block)
|
55
41
|
@after = block
|
56
42
|
end
|
57
43
|
|
@@ -73,7 +59,6 @@ module PryTest
|
|
73
59
|
wrapper.create_method(:after, &@after) if @after
|
74
60
|
tests << wrapper
|
75
61
|
end
|
76
|
-
|
77
62
|
end
|
78
63
|
end
|
79
64
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "monitor"
|
2
4
|
|
3
5
|
module PryTest
|
4
|
-
|
5
6
|
# A wrapper class for individual tests.
|
6
7
|
# Exists for the purpose of isolating the test method so it can run in its own thread.
|
7
8
|
class TestWrapper
|
@@ -29,13 +30,16 @@ module PryTest
|
|
29
30
|
end
|
30
31
|
|
31
32
|
# callback stubs
|
32
|
-
def before
|
33
|
-
|
33
|
+
def before
|
34
|
+
end
|
35
|
+
|
36
|
+
def after
|
37
|
+
end
|
34
38
|
|
35
39
|
# Runs the test code.
|
36
40
|
# @formatter [PryTest::Formatter] The formatter to use.
|
37
41
|
# @options [Hash]
|
38
|
-
def invoke(formatter, options={})
|
42
|
+
def invoke(formatter, options = {})
|
39
43
|
@formatter = formatter
|
40
44
|
@options = options
|
41
45
|
@formatter.before_test(self)
|
@@ -45,7 +49,7 @@ module PryTest
|
|
45
49
|
@invoked = true
|
46
50
|
@duration = Time.now - start
|
47
51
|
after
|
48
|
-
@formatter.after_test(self)
|
52
|
+
@formatter.after_test(self) unless asserts.empty?
|
49
53
|
end
|
50
54
|
|
51
55
|
# A basic assert method to be used within tests.
|
@@ -59,9 +63,10 @@ module PryTest
|
|
59
63
|
# end
|
60
64
|
# end
|
61
65
|
def assert(value)
|
62
|
-
|
66
|
+
info = assert_info(value, caller_locations(1..1).first)
|
67
|
+
asserts << info.merge(value: value)
|
63
68
|
|
64
|
-
|
69
|
+
unless value
|
65
70
|
Pry.start unless @options[:disable_pry]
|
66
71
|
|
67
72
|
# TODO: I don't really like the coupling to the runner here
|
@@ -71,6 +76,20 @@ module PryTest
|
|
71
76
|
value
|
72
77
|
end
|
73
78
|
|
79
|
+
# A basic refute method to be used within tests.
|
80
|
+
#
|
81
|
+
# @param [Object] value The value to refute.
|
82
|
+
#
|
83
|
+
# @example
|
84
|
+
# class SimpleTest < PryTest::Test
|
85
|
+
# test "common sense" do
|
86
|
+
# refute 0 > 1
|
87
|
+
# end
|
88
|
+
# end
|
89
|
+
def refute(value)
|
90
|
+
assert !value
|
91
|
+
end
|
92
|
+
|
74
93
|
# Indicates if this test has been invoked.
|
75
94
|
# @return [Boolean]
|
76
95
|
def invoked?
|
@@ -79,13 +98,14 @@ module PryTest
|
|
79
98
|
|
80
99
|
# Indicates if this test passed.
|
81
100
|
def passed?
|
82
|
-
return false
|
83
|
-
|
101
|
+
return false unless invoked?
|
102
|
+
return true if asserts.empty?
|
103
|
+
asserts.map { |a| !!a[:value] }.uniq == [true]
|
84
104
|
end
|
85
105
|
|
86
106
|
# Returns a list of all failed asserts.
|
87
107
|
def failed_asserts
|
88
|
-
|
108
|
+
asserts.select { |a| !a[:value] }
|
89
109
|
end
|
90
110
|
|
91
111
|
# Rounded duration.
|
@@ -96,9 +116,10 @@ module PryTest
|
|
96
116
|
|
97
117
|
private
|
98
118
|
|
99
|
-
# Builds a Hash of assert information for the given call stack.
|
119
|
+
# Builds a Hash of assert information for the given assert value & call stack location.
|
100
120
|
#
|
101
|
-
# @
|
121
|
+
# @params [Boolean] value The value of assert.
|
122
|
+
# @param [Thread::Backtrace::Location] location The call stack location to extract info from.
|
102
123
|
#
|
103
124
|
# @example
|
104
125
|
# {
|
@@ -108,27 +129,33 @@ module PryTest
|
|
108
129
|
# }
|
109
130
|
#
|
110
131
|
# @return [Hash]
|
111
|
-
def assert_info(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
line_index = line_num - 1
|
116
|
-
line = lines[line_index]
|
117
|
-
{
|
118
|
-
:file_path => file_path,
|
119
|
-
:lines => lines,
|
120
|
-
:line_num => line_num,
|
121
|
-
:line => line
|
132
|
+
def assert_info(value, location)
|
133
|
+
info = {
|
134
|
+
file_path: location.absolute_path,
|
135
|
+
line_num: location.lineno
|
122
136
|
}
|
123
|
-
end
|
124
137
|
|
125
|
-
|
126
|
-
|
127
|
-
# @param [Integer] index The index of the call stack entry to use.
|
128
|
-
# @return [String]
|
129
|
-
def line_number(stack, index)
|
130
|
-
stack[index].scan(/:[0-9]+:/).first.gsub(/:/, "").to_i
|
138
|
+
info.merge! line_info(location) unless value
|
139
|
+
info
|
131
140
|
end
|
132
141
|
|
142
|
+
# Builds a Hash of line/source information for the given call stack location.
|
143
|
+
#
|
144
|
+
# @param [Thread::Backtrace::Location] location The call stack location to extract info from.
|
145
|
+
#
|
146
|
+
# @example
|
147
|
+
# {
|
148
|
+
# :lines => ["line one", "line two"]
|
149
|
+
# :line => "line two"
|
150
|
+
# }
|
151
|
+
#
|
152
|
+
# @return [Hash]
|
153
|
+
def line_info(location)
|
154
|
+
lines = File.open(location.absolute_path).readlines
|
155
|
+
{
|
156
|
+
lines: lines,
|
157
|
+
line: lines[location.lineno]
|
158
|
+
}
|
159
|
+
end
|
133
160
|
end
|
134
161
|
end
|
data/lib/pry-test/version.rb
CHANGED
data/test/color_test.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
unless ENV["PRY_TEST_DEMO"]
|
2
4
|
require_relative "test_helper"
|
3
5
|
|
@@ -51,7 +53,6 @@ unless ENV["PRY_TEST_DEMO"]
|
|
51
53
|
assert PryTest::Color.gray("foo") == "\e[90mfoo\e[0m"
|
52
54
|
assert ColorTest::CRAYON.gray("foo") == "\e[90mfoo\e[0m"
|
53
55
|
end
|
54
|
-
|
55
56
|
end
|
56
57
|
|
57
58
|
end
|
data/test/demos/fail_test.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
if ENV["PRY_TEST_DEMO"]
|
2
4
|
require_relative "../test_helper"
|
3
5
|
|
4
6
|
class Fail < PryTest::Test
|
5
|
-
|
6
7
|
before do
|
7
8
|
@var = "fubar"
|
8
9
|
end
|
@@ -13,6 +14,5 @@ if ENV["PRY_TEST_DEMO"]
|
|
13
14
|
# For example, type @var.
|
14
15
|
assert false
|
15
16
|
end
|
16
|
-
|
17
17
|
end
|
18
18
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
if ENV["PRY_TEST_DEMO"]
|
2
4
|
require_relative "../test_helper"
|
3
5
|
|
4
6
|
class TestIOLatency < PryTest::Test
|
5
|
-
|
6
7
|
test "sleep 1 sec" do
|
7
8
|
sleep 1
|
8
9
|
assert true
|
@@ -17,6 +18,5 @@ if ENV["PRY_TEST_DEMO"]
|
|
17
18
|
sleep 1
|
18
19
|
assert true
|
19
20
|
end
|
20
|
-
|
21
21
|
end
|
22
22
|
end
|
data/test/runner_test.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
unless ENV["PRY_TEST_DEMO"]
|
2
4
|
require_relative "test_helper"
|
3
5
|
|
4
6
|
class TestRunner < PryTest::Test
|
5
|
-
|
6
7
|
before do
|
7
8
|
@runner = PryTest::Runner.new(PryTest::DefaultFormatter.new)
|
8
9
|
end
|
@@ -11,5 +12,7 @@ unless ENV["PRY_TEST_DEMO"]
|
|
11
12
|
assert true
|
12
13
|
end
|
13
14
|
|
15
|
+
test "empty test" do
|
16
|
+
end
|
14
17
|
end
|
15
18
|
end
|
data/test/test_helper.rb
CHANGED
data/test/test_test.rb
CHANGED
@@ -1,59 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
unless ENV["PRY_TEST_DEMO"]
|
2
4
|
require_relative "test_helper"
|
3
5
|
|
4
6
|
class TestTest < PryTest::Test
|
5
|
-
|
6
7
|
before do
|
7
8
|
@test_test = TestTest.clone
|
8
9
|
@test_test.instance_eval { @subclasses = [] }
|
9
10
|
@test_test.instance_eval { @tests = [] }
|
10
|
-
@
|
11
|
+
@example = Class.new(@test_test) {
|
11
12
|
before {}
|
12
13
|
after {}
|
13
14
|
test("truth") { assert true }
|
14
|
-
|
15
|
-
@before_callback = @
|
16
|
-
@after_callback = @
|
15
|
+
}
|
16
|
+
@before_callback = @example.before
|
17
|
+
@after_callback = @example.after
|
17
18
|
end
|
18
19
|
|
19
20
|
test "adds subclass" do
|
20
21
|
assert @test_test.subclasses.length == 1
|
21
|
-
assert @test_test.subclasses[0] == @
|
22
|
+
assert @test_test.subclasses[0] == @example
|
22
23
|
end
|
23
24
|
|
24
25
|
test "stores subclasses" do
|
25
26
|
assert @test_test.subclasses.is_a?(Array)
|
26
27
|
assert @test_test.subclasses.length == 1
|
27
|
-
assert @test_test.subclasses.first == @
|
28
|
+
assert @test_test.subclasses.first == @example
|
28
29
|
end
|
29
30
|
|
30
31
|
test "stores tests" do
|
31
|
-
assert @
|
32
|
-
assert @
|
33
|
-
assert @
|
34
|
-
end
|
35
|
-
|
36
|
-
test "stores files" do
|
37
|
-
file = __FILE__
|
38
|
-
assert @test_test.files[file].is_a?(Array)
|
39
|
-
assert @test_test.files[file].select{ |l| l.start_with?(" assert @test_test.files[file].select{ |l| l.start_with?(") }.length > 0
|
32
|
+
assert @example.tests.is_a?(Array)
|
33
|
+
assert @example.tests.length == 1
|
34
|
+
assert @example.tests.first.is_a?(PryTest::TestWrapper)
|
40
35
|
end
|
41
36
|
|
42
37
|
test ".before" do
|
43
|
-
assert @
|
38
|
+
assert @example.instance_eval { @before } == @before_callback
|
44
39
|
end
|
45
40
|
|
46
41
|
test ".after" do
|
47
|
-
assert @
|
42
|
+
assert @example.instance_eval { @after } == @after_callback
|
48
43
|
end
|
49
44
|
|
50
45
|
test "tests" do
|
51
46
|
t = lambda {}
|
52
|
-
@
|
53
|
-
assert @
|
54
|
-
assert @
|
55
|
-
assert @
|
47
|
+
@example.send :test, :add_a_test, &t
|
48
|
+
assert @example.tests.length == 2
|
49
|
+
assert @example.tests.last.is_a?(PryTest::TestWrapper)
|
50
|
+
assert @example.tests.last.desc == :add_a_test
|
56
51
|
end
|
57
|
-
|
58
52
|
end
|
59
53
|
end
|
data/test/test_wrapper_test.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
unless ENV["PRY_TEST_DEMO"]
|
2
4
|
require_relative "test_helper"
|
3
5
|
|
4
6
|
class TestWrapperTest < PryTest::Test
|
5
|
-
|
6
7
|
test ".new" do
|
7
8
|
desc = "test_#{rand(999**10)}"
|
8
9
|
meth = lambda { ".new" }
|
@@ -15,5 +16,12 @@ unless ENV["PRY_TEST_DEMO"]
|
|
15
16
|
assert t.asserts.empty?
|
16
17
|
end
|
17
18
|
|
19
|
+
test ".assert" do
|
20
|
+
assert true
|
21
|
+
end
|
22
|
+
|
23
|
+
test ".refute" do
|
24
|
+
refute false
|
25
|
+
end
|
18
26
|
end
|
19
27
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.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: 2020-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: os
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: pry
|
28
|
+
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: pry-stack_explorer
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
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'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: magic_frozen_string_literal
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: rake
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +137,7 @@ dependencies:
|
|
109
137
|
- !ruby/object:Gem::Version
|
110
138
|
version: '0'
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
140
|
+
name: standard
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
114
142
|
requirements:
|
115
143
|
- - ">="
|
@@ -132,6 +160,7 @@ extensions: []
|
|
132
160
|
extra_rdoc_files: []
|
133
161
|
files:
|
134
162
|
- bin/pry-test
|
163
|
+
- bin/standardize
|
135
164
|
- lib/pry-test.rb
|
136
165
|
- lib/pry-test/formatters/base_formatter.rb
|
137
166
|
- lib/pry-test/formatters/color.rb
|
@@ -159,7 +188,7 @@ homepage: https://github.com/hopsoft/pry-test
|
|
159
188
|
licenses:
|
160
189
|
- MIT
|
161
190
|
metadata: {}
|
162
|
-
post_install_message:
|
191
|
+
post_install_message:
|
163
192
|
rdoc_options: []
|
164
193
|
require_paths:
|
165
194
|
- lib
|
@@ -174,18 +203,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
203
|
- !ruby/object:Gem::Version
|
175
204
|
version: '0'
|
176
205
|
requirements: []
|
177
|
-
|
178
|
-
|
179
|
-
signing_key:
|
206
|
+
rubygems_version: 3.0.3
|
207
|
+
signing_key:
|
180
208
|
specification_version: 4
|
181
209
|
summary: A small test framework that supports debugging test failures and errors when
|
182
210
|
they happen.
|
183
211
|
test_files:
|
212
|
+
- test/runner_test.rb
|
213
|
+
- test/test_wrapper_test.rb
|
184
214
|
- test/color_test.rb
|
215
|
+
- test/test_test.rb
|
216
|
+
- test/test_helper.rb
|
185
217
|
- test/demos/fail_test.rb
|
186
218
|
- test/demos/io_latency_test.rb
|
187
|
-
- test/runner_test.rb
|
188
|
-
- test/test_helper.rb
|
189
|
-
- test/test_test.rb
|
190
|
-
- test/test_wrapper_test.rb
|
191
|
-
has_rdoc:
|