rantly 2.0.0 → 3.0.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/Gemfile +2 -1
- data/README.md +1 -1
- data/VERSION.yml +3 -3
- data/lib/rantly/generator.rb +1 -0
- data/lib/rantly/minitest_extensions.rb +1 -0
- data/lib/rantly/property.rb +5 -5
- data/lib/rantly/rspec_extensions.rb +1 -1
- data/lib/rantly/shrinks.rb +10 -11
- data/rantly.gemspec +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 406db7ec111ce8f3580b6f76970b4baf110bae5926a5cc476f55ee435d857b4a
|
4
|
+
data.tar.gz: 5e42ee8b71cd692f7cd330fce8e3b65807ee9405afeb5ef2a847111da8ebefea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d83625897b4e83a7fed19c07922d2f456e14e69f86d56fdc0d13e7e0651ac71f28d897f2208815c383e602c7ab2093c3e28b33fd9b9eb957869764d117009c7a
|
7
|
+
data.tar.gz: d2362962331c07a90c37622ef9cef880de4cbb982daa04cc4cf5c38b178202616b6637527d03249e6941beeab588a57329fc982a09237041bdb231bbca467c9a
|
data/Gemfile
CHANGED
@@ -3,8 +3,9 @@ source 'https://rubygems.org'
|
|
3
3
|
group :development, :test do
|
4
4
|
gem 'coveralls', '>= 0', require: false
|
5
5
|
gem 'minitest', '~> 5.10.0'
|
6
|
-
gem 'rake', '~> 12.
|
6
|
+
gem 'rake', '~> 12.3.3'
|
7
7
|
gem 'simplecov', '>= 0'
|
8
8
|
|
9
9
|
gem 'rubocop'
|
10
|
+
gem 'rubocop-performance', require: false
|
10
11
|
end
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Its implementation has no alien mathematics inside. Completely side-effect-free-
|
|
15
15
|
|
16
16
|
# Install
|
17
17
|
|
18
|
-
Rantly requires Ruby 2
|
18
|
+
Rantly requires Ruby 3.2 or higher. To install Rantly add it to your Gemfile or run:
|
19
19
|
|
20
20
|
```ruby
|
21
21
|
$ gem install rantly
|
data/VERSION.yml
CHANGED
data/lib/rantly/generator.rb
CHANGED
data/lib/rantly/property.rb
CHANGED
@@ -5,12 +5,12 @@ require 'stringio'
|
|
5
5
|
class Rantly::Property
|
6
6
|
attr_reader :failed_data, :shrunk_failed_data
|
7
7
|
|
8
|
-
VERBOSITY = ENV.fetch('RANTLY_VERBOSE'
|
9
|
-
RANTLY_COUNT = ENV.fetch('RANTLY_COUNT'
|
8
|
+
VERBOSITY = ENV.fetch('RANTLY_VERBOSE', 1).to_i
|
9
|
+
RANTLY_COUNT = ENV.fetch('RANTLY_COUNT', 100).to_i
|
10
10
|
|
11
11
|
def io
|
12
12
|
@io ||= if VERBOSITY >= 1
|
13
|
-
|
13
|
+
$stdout
|
14
14
|
else
|
15
15
|
StringIO.new
|
16
16
|
end
|
@@ -41,7 +41,7 @@ class Rantly::Property
|
|
41
41
|
io.puts
|
42
42
|
io.puts "FAILURE - #{i} successful tests, too many tries: #{e.tries}"
|
43
43
|
raise e.exception("#{i} successful tests, too many tries: #{e.tries} (limit: #{e.limit})")
|
44
|
-
rescue Exception =>
|
44
|
+
rescue Exception => e
|
45
45
|
io.puts
|
46
46
|
io.puts "FAILURE - #{i} successful tests, failed on:"
|
47
47
|
pretty_print test_data
|
@@ -51,7 +51,7 @@ class Rantly::Property
|
|
51
51
|
io.puts "Minimal failed data (depth #{@depth}) is:"
|
52
52
|
pretty_print @shrunk_failed_data
|
53
53
|
end
|
54
|
-
raise
|
54
|
+
raise e.exception("#{i} successful tests, failed on:\n#{test_data}\n\n#{e}\n")
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/lib/rantly/shrinks.rb
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
# Integer : shrink to zero
|
2
2
|
class Integer
|
3
3
|
def shrink
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
if self > 8
|
5
|
+
self / 2
|
6
|
+
elsif self > 0
|
7
|
+
self - 1
|
8
|
+
elsif self < -8
|
9
|
+
(self + 1) / 2
|
10
|
+
elsif self < 0
|
11
|
+
self + 1
|
12
|
+
else
|
13
|
+
0
|
14
14
|
end
|
15
|
-
shrunk
|
16
15
|
end
|
17
16
|
|
18
17
|
def retry?
|
data/rantly.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'rantly'
|
3
3
|
s.summary = 'Ruby Imperative Random Data Generator and Quickcheck'
|
4
4
|
s.homepage = 'https://github.com/rantly-rb/rantly'
|
5
|
-
s.version = '
|
5
|
+
s.version = '3.0.0'
|
6
6
|
s.license = 'MIT'
|
7
7
|
s.require_paths = ['lib']
|
8
8
|
s.authors = ['Ana María Martínez Gómez', 'Howard Yeh', 'Anthony Bargnesi', 'Eric Bischoff']
|
@@ -38,5 +38,5 @@ Gem::Specification.new do |s|
|
|
38
38
|
'test/shrinks_test.rb',
|
39
39
|
'test/test_helper.rb'
|
40
40
|
]
|
41
|
-
s.required_ruby_version = '>=
|
41
|
+
s.required_ruby_version = '>= 3.3.0'
|
42
42
|
end
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rantly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ana María Martínez Gómez
|
8
8
|
- Howard Yeh
|
9
9
|
- Anthony Bargnesi
|
10
10
|
- Eric Bischoff
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-10-21 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
|
-
description:
|
16
|
+
description:
|
17
17
|
email:
|
18
18
|
- anamma06@gmail.com
|
19
19
|
- hayeah@gmail.com
|
@@ -54,7 +54,7 @@ homepage: https://github.com/rantly-rb/rantly
|
|
54
54
|
licenses:
|
55
55
|
- MIT
|
56
56
|
metadata: {}
|
57
|
-
post_install_message:
|
57
|
+
post_install_message:
|
58
58
|
rdoc_options: []
|
59
59
|
require_paths:
|
60
60
|
- lib
|
@@ -62,15 +62,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
65
|
+
version: 3.3.0
|
66
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
73
|
-
signing_key:
|
72
|
+
rubygems_version: 3.5.9
|
73
|
+
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Ruby Imperative Random Data Generator and Quickcheck
|
76
76
|
test_files: []
|