pry-test 0.5.4 → 0.5.5
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/bin/pry-test +46 -33
- data/ext/mkrf_conf.rb +13 -12
- data/lib/pry-test.rb +1 -4
- data/lib/pry-test/version.rb +1 -1
- data/test/color_test.rb +5 -0
- data/test/{cpu_latency_test.rb → demos/cpu_latency_test.rb} +2 -1
- data/test/{fail_test.rb → demos/fail_test.rb} +1 -1
- data/test/{io_latency_test.rb → demos/io_latency_test.rb} +1 -1
- data/test/test_helper.rb +0 -5
- metadata +25 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b74d2ed52a6c240c8fce9857115a28f19f12c192
|
4
|
+
data.tar.gz: 73d23a617531c4452414e150b595262f3ac0a2de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e904e78144a5a9efa74cb91ae3fba9c699fd6865efee22e7e8731015e064add2762525a792a43be1c2f45af9dc8f36d62a9eca190ecdbc3deb0a33ef801d42
|
7
|
+
data.tar.gz: ce72d5cd0e13d3b25674155a84c3136cc2bab9d9324610f4df563f99085e410bdb7e368f06f3508e919aa9082c4e610c0a1cf4f44e6d090b1d3efe709d93efd3
|
data/bin/pry-test
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require "optparse"
|
3
|
-
require_relative "../lib/pry-test"
|
4
|
-
|
5
|
-
include PryTest::Color
|
6
2
|
|
7
|
-
|
8
|
-
formatter_names = PryTest.formatters.map(&:short_name).sort
|
3
|
+
require "optparse"
|
9
4
|
|
10
5
|
# setup the options -----------------------------------------------------------
|
11
6
|
options = {}
|
@@ -18,7 +13,7 @@ parser = OptionParser.new do |opts|
|
|
18
13
|
desc = "Runs the PryTest test suite and some additional demo tests."
|
19
14
|
opts.on("--demo", desc) { |value| options[:demo] = value }
|
20
15
|
|
21
|
-
desc = "The formatter to use.
|
16
|
+
desc = "The formatter to use."
|
22
17
|
opts.on("-f", "--formatter [FORMATTER]", desc) do |value|
|
23
18
|
options[:formatter] = value
|
24
19
|
end
|
@@ -43,42 +38,60 @@ parser.parse!
|
|
43
38
|
|
44
39
|
ENV["PRY_TEST_DEMO"] = "true" if options[:demo]
|
45
40
|
|
46
|
-
|
47
|
-
path = ARGV.last unless ARGV.last =~ /^-/
|
48
|
-
path = File.expand_path("../../test", __FILE__) if options[:demo]
|
49
|
-
path ||= "test"
|
50
|
-
path = File.join(Dir.pwd, path) unless path =~ /^\//
|
51
|
-
unless File.exist?(path)
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
56
|
-
if path =~ /\.rb$/
|
57
|
-
|
58
|
-
else
|
59
|
-
Dir[File.join(path, "**/*.rb")].each { |path| require path }
|
60
|
-
end
|
61
|
-
|
62
|
-
# setup the formatter ---------------------------------------------------------
|
63
|
-
formatter = PryTest.formatters.find { |f| f.short_name == options[:formatter] }
|
64
|
-
formatter ||= begin
|
65
|
-
if options[:async]
|
66
|
-
PryTest.formatters.find { |f| f.short_name == "default_async" }
|
41
|
+
def require_tests(options)
|
42
|
+
path = ARGV.last unless ARGV.last =~ /^-/
|
43
|
+
path = File.expand_path("../../test", __FILE__) if options[:demo]
|
44
|
+
path ||= "test"
|
45
|
+
path = File.join(Dir.pwd, path) unless path =~ /^\//
|
46
|
+
unless File.exist?(path)
|
47
|
+
puts "#{path} not found."
|
48
|
+
puts "Please check the path and try again."
|
49
|
+
exit 1
|
50
|
+
end
|
51
|
+
if path =~ /\.rb$/
|
52
|
+
require path
|
67
53
|
else
|
68
|
-
|
54
|
+
Dir[File.join(path, "**/*.rb")].each { |path| require path }
|
69
55
|
end
|
70
56
|
end
|
71
57
|
|
72
|
-
|
73
|
-
|
58
|
+
def runner(options)
|
59
|
+
formatter = PryTest.formatters.find { |f| f.short_name == options[:formatter] }
|
60
|
+
formatter ||= begin
|
61
|
+
if options[:async]
|
62
|
+
PryTest.formatters.find { |f| f.short_name == "default_async" }
|
63
|
+
else
|
64
|
+
PryTest.formatters.find { |f| f.short_name == "default" }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
PryTest::Runner.new(formatter.new, options)
|
68
|
+
end
|
74
69
|
|
75
70
|
# setup pry -------------------------------------------------------------------
|
76
71
|
options[:disable_pry] ||= options[:async] || RUBY_ENGINE == "jruby" || RUBY_ENGINE == "rbx"
|
77
72
|
|
78
73
|
if options[:disable_pry]
|
74
|
+
if ENV["PRY_TEST_COVERAGE"]
|
75
|
+
require "simplecov"
|
76
|
+
require "coveralls"
|
77
|
+
SimpleCov.command_name "pry-test"
|
78
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
79
|
+
SimpleCov.start do
|
80
|
+
add_filter "test/*.rb"
|
81
|
+
add_filter "bin"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
require_relative "../lib/pry-test"
|
86
|
+
require_tests options
|
87
|
+
include PryTest::Color
|
79
88
|
puts magenta("Disabling pry when running with: [#{RUBY_ENGINE}] #{options.inspect}")
|
80
|
-
exit runner.run
|
89
|
+
exit runner(options).run
|
81
90
|
else
|
91
|
+
require_relative "../lib/pry-test"
|
92
|
+
require_tests options
|
93
|
+
include PryTest::Color
|
94
|
+
|
82
95
|
begin
|
83
96
|
require "pry"
|
84
97
|
require "pry-stack_explorer"
|
@@ -104,5 +117,5 @@ else
|
|
104
117
|
puts
|
105
118
|
end
|
106
119
|
|
107
|
-
exit Pry.rescue { runner.run }
|
120
|
+
exit Pry.rescue { runner(options).run }
|
108
121
|
end
|
data/ext/mkrf_conf.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# based on instructions here:
|
2
2
|
# http://en.wikibooks.org/wiki/Ruby_Programming/RubyGems#How_to_install_different_versions_of_gems_depending_on_which_version_of_ruby_the_installee_is_using
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require "rubygems"
|
4
|
+
require "rubygems/command.rb"
|
5
|
+
require "rubygems/dependency_installer.rb"
|
6
6
|
|
7
7
|
begin
|
8
8
|
Gem::Command.build_args = ARGV
|
@@ -12,22 +12,23 @@ end
|
|
12
12
|
installer = Gem::DependencyInstaller.new
|
13
13
|
|
14
14
|
begin
|
15
|
-
if
|
16
|
-
puts "
|
15
|
+
if RUBY_ENGINE =~ /jruby/i
|
16
|
+
puts "Engine is jruby... skip installation of pry gems."
|
17
|
+
else
|
18
|
+
puts "Installing pry gems..."
|
17
19
|
installer.install "pry"
|
18
20
|
installer.install "pry-stack_explorer"
|
19
21
|
installer.install "pry-rescue"
|
20
|
-
else
|
21
|
-
puts "Platform is java... skip install for pry and pry-stack_explorer."
|
22
22
|
end
|
23
23
|
rescue Exception => e
|
24
24
|
puts e.message
|
25
25
|
puts e.backtrace.join("\n")
|
26
|
-
exit
|
26
|
+
exit 1
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
# create dummy rakefile to indicate success
|
30
|
+
File.open(File.expand_path("../Rakefile", __FILE__), "w") do |file|
|
31
|
+
file.write("task :default\n")
|
32
|
+
end
|
32
33
|
|
33
|
-
exit
|
34
|
+
exit 0
|
data/lib/pry-test.rb
CHANGED
data/lib/pry-test/version.rb
CHANGED
data/test/color_test.rb
CHANGED
@@ -42,6 +42,11 @@ unless ENV["PRY_TEST_DEMO"]
|
|
42
42
|
assert ColorTest::CRAYON.white("foo") == "\e[37mfoo\e[0m"
|
43
43
|
end
|
44
44
|
|
45
|
+
test "gray" do
|
46
|
+
assert PryTest::Color.gray("foo") == "\e[90mfoo\e[0m"
|
47
|
+
assert ColorTest::CRAYON.gray("foo") == "\e[90mfoo\e[0m"
|
48
|
+
end
|
49
|
+
|
45
50
|
end
|
46
51
|
|
47
52
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: os
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: simplecov
|
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'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: coveralls
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,7 +66,7 @@ dependencies:
|
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
|
-
description: A
|
69
|
+
description: A small test framework that supports debugging test failures and errors
|
56
70
|
when they happen.
|
57
71
|
email:
|
58
72
|
- natehop@gmail.com
|
@@ -81,9 +95,9 @@ files:
|
|
81
95
|
- lib/pry-test/test_wrapper.rb
|
82
96
|
- lib/pry-test/version.rb
|
83
97
|
- test/color_test.rb
|
84
|
-
- test/cpu_latency_test.rb
|
85
|
-
- test/fail_test.rb
|
86
|
-
- test/io_latency_test.rb
|
98
|
+
- test/demos/cpu_latency_test.rb
|
99
|
+
- test/demos/fail_test.rb
|
100
|
+
- test/demos/io_latency_test.rb
|
87
101
|
- test/runner_test.rb
|
88
102
|
- test/test_helper.rb
|
89
103
|
- test/test_test.rb
|
@@ -111,14 +125,15 @@ rubyforge_project:
|
|
111
125
|
rubygems_version: 2.2.2
|
112
126
|
signing_key:
|
113
127
|
specification_version: 4
|
114
|
-
summary: A
|
128
|
+
summary: A small test framework that supports debugging test failures and errors when
|
115
129
|
they happen.
|
116
130
|
test_files:
|
117
131
|
- test/color_test.rb
|
118
|
-
- test/cpu_latency_test.rb
|
119
|
-
- test/fail_test.rb
|
120
|
-
- test/io_latency_test.rb
|
132
|
+
- test/demos/cpu_latency_test.rb
|
133
|
+
- test/demos/fail_test.rb
|
134
|
+
- test/demos/io_latency_test.rb
|
121
135
|
- test/runner_test.rb
|
122
136
|
- test/test_helper.rb
|
123
137
|
- test/test_test.rb
|
124
138
|
- test/test_wrapper_test.rb
|
139
|
+
has_rdoc:
|