u-test 0.7.0 → 0.8.0
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/microtest.rb +3 -1
- metadata +3 -5
- data/test_runners.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c16b4ffa40f5366e18432111a6d5c6f0f8a1a171d2cbbbfe016318f72842d18e
|
4
|
+
data.tar.gz: 03acd8857a4e574b9bc0485a4eacd40b6953abd8626b3b846b7d33495769f8fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d36640a1247a6e8aa58c5e062e97e185ebd50f953e8d204535365d21f085dd511315ff0e7c8ce769de0034de512e2fe81bb838ff7fae2971b0567ceb9395d5
|
7
|
+
data.tar.gz: 467f7ade8d7445e6059e814a19d7cb3c42e5d194f631b73f5b5905937dd36e9ee6e38eea8df8876001bdc68398301524633371c7ac5f2b1da969ff62476b1041
|
data/microtest.rb
CHANGED
@@ -4,7 +4,7 @@ require 'set'
|
|
4
4
|
require 'singleton'
|
5
5
|
|
6
6
|
module Microtest
|
7
|
-
VERSION = '0.
|
7
|
+
VERSION = '0.8.0'
|
8
8
|
|
9
9
|
TryToBuildARandom = -> (seed, randomized) do
|
10
10
|
Random.new Integer(seed ? seed : rand(1000..99999)) if seed || randomized
|
@@ -41,6 +41,8 @@ module Microtest
|
|
41
41
|
shuffle_if_random(@test_cases, random).each do |test_case|
|
42
42
|
test_methods = test_case.public_instance_methods.grep(/\Atest_/)
|
43
43
|
|
44
|
+
next if test_methods.size == 0
|
45
|
+
|
44
46
|
yield method(:call_test).curry[test_case.new],
|
45
47
|
shuffle_if_random(test_methods, random)
|
46
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: u-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Serradura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A xUnit family unit testing microframework for Ruby.
|
14
14
|
email: rodrigo.serradura@gmail.com
|
@@ -17,7 +17,6 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- microtest.rb
|
20
|
-
- test_runners.rb
|
21
20
|
- u-test.rb
|
22
21
|
homepage: https://gist.github.com/serradura/d26f7f322977e35dd508c8c13a9179b1
|
23
22
|
licenses:
|
@@ -43,5 +42,4 @@ rubygems_version: 2.7.7
|
|
43
42
|
signing_key:
|
44
43
|
specification_version: 4
|
45
44
|
summary: A unit testing microframework
|
46
|
-
test_files:
|
47
|
-
- test_runners.rb
|
45
|
+
test_files: []
|
data/test_runners.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class RunRubyProgram
|
4
|
-
LINE_CHAR = '#'
|
5
|
-
|
6
|
-
def self.line(command)
|
7
|
-
(LINE_CHAR * command.size) + LINE_CHAR * 4
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.cmd(file)
|
11
|
-
yield "ruby #{file}.rb"
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.render_cmd(file)
|
15
|
-
cmd(file) do |command|
|
16
|
-
puts line(command)
|
17
|
-
puts "#{LINE_CHAR} #{command} #{LINE_CHAR}"
|
18
|
-
puts line(command)
|
19
|
-
|
20
|
-
yield(command) if block_given?
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.call(file)
|
25
|
-
render_cmd(file) { |command| system(command) }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
RunRubyProgram.call('test_runner')
|
30
|
-
|
31
|
-
RunRubyProgram.call('test_runner_to_assert_a_random_execution')
|
32
|
-
|
33
|
-
RunRubyProgram.call('test_runner_to_assert_an_execution_in_sequence')
|
34
|
-
|
35
|
-
RunRubyProgram.call('test_runner_to_assert_microtest_outputs')
|