rubyqc 0.0.1 → 0.0.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/.travis.yml +1 -1
- data/CHANGES.md +11 -0
- data/README.md +60 -9
- data/lib/rubyqc.rb +1 -14
- data/lib/rubyqc/all.rb +3 -0
- data/lib/rubyqc/api.rb +45 -0
- data/lib/rubyqc/prelude.rb +23 -15
- data/lib/rubyqc/stdlib.rb +8 -0
- data/lib/rubyqc/stdlib/delegate.rb +14 -0
- data/lib/rubyqc/stdlib/pathname.rb +8 -0
- data/lib/rubyqc/stdlib/socket.rb +60 -0
- data/lib/rubyqc/stdlib/stringio.rb +8 -0
- data/lib/rubyqc/stdlib/strscan.rb +8 -0
- data/lib/rubyqc/stdlib/tempfile.rb +8 -0
- data/lib/rubyqc/stdlib/weakref.rb +13 -0
- data/lib/rubyqc/version.rb +1 -1
- data/rubyqc.gemspec +15 -4
- data/test/test_api.rb +49 -3
- data/test/test_readme.rb +35 -0
- metadata +14 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a41de60f5a0b9675a0633fadaf4961e743661d
|
4
|
+
data.tar.gz: 5ec783f8ba6d9f68e0a58d2c5603d7b73da8e649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd3c8b14af326d8c19714f6172239bab8568e69d7cdb2fee46c525127532e63cc5bade28450efb0c0ec6378ac61143cfe0933d27ed2e15cff24cd5698fc03803
|
7
|
+
data.tar.gz: 1884e6da6b62adaf3ecfd71918c589988c7a1878bd59b36039b79d90c0f19a9ce2f75432e3ade0ca4e1793d1d2eb1ff46b45a629f6ef2ea95469e003989fa411
|
data/.travis.yml
CHANGED
data/CHANGES.md
ADDED
data/README.md
CHANGED
@@ -70,7 +70,7 @@ it and raise our level of confidence about correctness.
|
|
70
70
|
|
71
71
|
## REQUIREMENTS:
|
72
72
|
|
73
|
-
* Tested with MRI (official CRuby)
|
73
|
+
* Tested with MRI (official CRuby), Rubinius and JRuby.
|
74
74
|
|
75
75
|
## INSTALLATION:
|
76
76
|
|
@@ -78,6 +78,8 @@ it and raise our level of confidence about correctness.
|
|
78
78
|
|
79
79
|
## SYNOPSIS:
|
80
80
|
|
81
|
+
### RubyQC::API.check
|
82
|
+
|
81
83
|
Here's a quick example using [Bacon][]. We check if `Array#sort` has the
|
82
84
|
property that the front elements of the result array would be `<=` than
|
83
85
|
the rear elements of the result array for all arrays.
|
@@ -130,9 +132,36 @@ class Fixnum
|
|
130
132
|
end
|
131
133
|
```
|
132
134
|
|
133
|
-
You get the idea.
|
135
|
+
You get the idea.
|
136
|
+
|
137
|
+
### RubyQC::API.forall
|
134
138
|
|
135
|
-
|
139
|
+
Other than `check`, we also have `forall` which would iterate through all the
|
140
|
+
possible choices in case you would simply like to test all combinations.
|
141
|
+
Here's an example for checking compare_by_identity:
|
142
|
+
|
143
|
+
``` ruby
|
144
|
+
describe Hash do
|
145
|
+
describe 'compare_by_identity' do
|
146
|
+
should 'Treat diff arr with the same contents diff when set' do
|
147
|
+
arr = [0]
|
148
|
+
forall(booleans, [arr, [0]], [arr, [1]]) do |flag, a, b|
|
149
|
+
h = {}
|
150
|
+
h.compare_by_identity if flag
|
151
|
+
h[a] = h[b] = true
|
152
|
+
|
153
|
+
if (flag && a.object_id != b.object_id) || a != b
|
154
|
+
h.size.should == 2
|
155
|
+
else
|
156
|
+
h.size.should == 1
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
```
|
163
|
+
|
164
|
+
### Kernel generator
|
136
165
|
|
137
166
|
The very default generator would simply return the instance itself.
|
138
167
|
So if there's no generator defined for a given class or instance, it
|
@@ -142,7 +171,7 @@ would merely take `self`.
|
|
142
171
|
true.rubyqc # true
|
143
172
|
```
|
144
173
|
|
145
|
-
### Class
|
174
|
+
### Class generator
|
146
175
|
|
147
176
|
This default generator for classes would simply return a new instance via
|
148
177
|
`new` method. This could fail if the `initialize` method for the particular
|
@@ -152,7 +181,7 @@ class does not take zero argument.
|
|
152
181
|
Object.rubyqc # kind_of?(Object)
|
153
182
|
```
|
154
183
|
|
155
|
-
### Fixnum, Bignum, and Integer
|
184
|
+
### Fixnum, Bignum, and Integer generator
|
156
185
|
|
157
186
|
This would give you a random integer. Fixnum and Bignum would guarantee to
|
158
187
|
give you the particular class, whereas Integer would give you either a Fixnum
|
@@ -162,7 +191,7 @@ or Bignum.
|
|
162
191
|
Fixnum.rubyqc # kind_of?(Fixnum)
|
163
192
|
```
|
164
193
|
|
165
|
-
### array
|
194
|
+
### array generator
|
166
195
|
|
167
196
|
We also have instance level generator, which was used in the first example.
|
168
197
|
The array instance generator would recursively call `rubyqc` for all elements
|
@@ -172,7 +201,7 @@ of the array, and collect the results.
|
|
172
201
|
[Fixnum, Fixnum].rubyqc # [kind_of?(Fixnum), kind_of?(Fixnum)]
|
173
202
|
```
|
174
203
|
|
175
|
-
### hash
|
204
|
+
### hash generator
|
176
205
|
|
177
206
|
This also applies to hashes which would do the same thing as arrays for the
|
178
207
|
values, keeping the key.
|
@@ -181,7 +210,7 @@ values, keeping the key.
|
|
181
210
|
{:fixnum => Fixnum}.rubyqc # {:fixnum => kind_of?(Fixnum)}
|
182
211
|
```
|
183
212
|
|
184
|
-
### range
|
213
|
+
### range generator
|
185
214
|
|
186
215
|
Fixnum would actually give a very large or very small (negative) number in
|
187
216
|
most cases. If you want to have a number with specific range, use a range
|
@@ -199,10 +228,32 @@ combinators we need to have a unified interface.
|
|
199
228
|
Just define `rubyqc` method for your classes or instances. This weird name
|
200
229
|
was simply chosen to avoid name conflicting since we don't have [typeclass][]
|
201
230
|
in Ruby, and it's quite natural to open and insert new methods into classes
|
202
|
-
in Ruby.
|
231
|
+
in Ruby. Here's a quick example:
|
232
|
+
|
233
|
+
``` ruby
|
234
|
+
class User < Struct.new(:id, :name)
|
235
|
+
def self.rubyqc
|
236
|
+
new(Fixnum.rubyqc, String.rubyqc)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
describe 'User.rubyqc' do
|
241
|
+
should 'Generate random users' do
|
242
|
+
check(User) do |user|
|
243
|
+
user .should.kind_of User
|
244
|
+
user.id .should.kind_of Fixnum
|
245
|
+
user.name.should.kind_of String
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
```
|
203
250
|
|
204
251
|
[typeclass]: http://learnyouahaskell.com/types-and-typeclasses
|
205
252
|
|
253
|
+
### Implementation reference
|
254
|
+
|
255
|
+
[QuickCheck.hs](http://www.cse.chalmers.se/~rjmh/QuickCheck/QuickCheck.hs)
|
256
|
+
|
206
257
|
## CONTRIBUTORS:
|
207
258
|
|
208
259
|
* Lin Jen-Shin (@godfat)
|
data/lib/rubyqc.rb
CHANGED
@@ -1,16 +1,3 @@
|
|
1
1
|
|
2
|
+
require 'rubyqc/api'
|
2
3
|
require 'rubyqc/prelude'
|
3
|
-
require 'rubyqc/modifier'
|
4
|
-
|
5
|
-
module RubyQC
|
6
|
-
module API
|
7
|
-
module_function
|
8
|
-
def check *args, &block
|
9
|
-
RubyQC::Modifier.new(args, &block)
|
10
|
-
end
|
11
|
-
|
12
|
-
def one_of *args
|
13
|
-
args.sample
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/rubyqc/all.rb
ADDED
data/lib/rubyqc/api.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
require 'rubyqc/modifier'
|
3
|
+
|
4
|
+
module RubyQC
|
5
|
+
module API
|
6
|
+
module_function
|
7
|
+
def check *args, &block
|
8
|
+
RubyQC::Modifier.new(args, &block)
|
9
|
+
end
|
10
|
+
|
11
|
+
def forall *args, &block
|
12
|
+
args[0].product(*args[1..-1]).each do |val|
|
13
|
+
yield(*val)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def booleans
|
18
|
+
[true, false]
|
19
|
+
end
|
20
|
+
|
21
|
+
class SomeOf < Struct.new(:num, :args)
|
22
|
+
def rubyqc
|
23
|
+
args.sample(num).rubyqc
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class OneOf < SomeOf
|
28
|
+
def initialize args
|
29
|
+
super(1, args)
|
30
|
+
end
|
31
|
+
|
32
|
+
def rubyqc
|
33
|
+
super.first
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def someof num, *args
|
38
|
+
SomeOf.new(num, args)
|
39
|
+
end
|
40
|
+
|
41
|
+
def oneof *args
|
42
|
+
OneOf.new(args)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/rubyqc/prelude.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
|
2
2
|
module RubyQC
|
3
|
-
|
3
|
+
big = 2 ** (0.size * 8 - 2)
|
4
|
+
FixnumMax = if big.kind_of?(Bignum)
|
5
|
+
big - 1
|
6
|
+
else # probably jruby...
|
7
|
+
2 ** (0.size * 8 - 1) - 1
|
8
|
+
end
|
4
9
|
FixnumMin = - FixnumMax - 1
|
5
10
|
FixnumSuc = FixnumMax + 1
|
6
11
|
BignumMax = FixnumMax * 10
|
@@ -20,6 +25,9 @@ end
|
|
20
25
|
class Class
|
21
26
|
def rubyqc
|
22
27
|
new
|
28
|
+
rescue => e
|
29
|
+
warn "Cannot new #{self}: #{e}"
|
30
|
+
raise
|
23
31
|
end
|
24
32
|
end
|
25
33
|
|
@@ -65,17 +73,15 @@ class UnboundMethod
|
|
65
73
|
end
|
66
74
|
end
|
67
75
|
|
68
|
-
# TODO
|
69
76
|
class Binding
|
70
77
|
def self.rubyqc
|
71
78
|
binding
|
72
79
|
end
|
73
80
|
end
|
74
81
|
|
75
|
-
# TODO
|
76
82
|
class Symbol
|
77
83
|
def self.rubyqc
|
78
|
-
|
84
|
+
all_symbols.sample
|
79
85
|
end
|
80
86
|
end
|
81
87
|
|
@@ -85,15 +91,16 @@ class Encoding
|
|
85
91
|
end
|
86
92
|
end
|
87
93
|
|
88
|
-
# TODO
|
89
94
|
class Dir
|
90
95
|
def self.rubyqc
|
91
|
-
Dir.open(
|
96
|
+
Dir.open(File.dirname($LOADED_FEATURES.sample))
|
92
97
|
end
|
93
98
|
end
|
94
99
|
|
95
100
|
class File
|
96
101
|
def self.rubyqc
|
102
|
+
File.open($LOADED_FEATURES.sample)
|
103
|
+
rescue Errno::ENOENT # e.g. thread.rb, enumerator.so
|
97
104
|
File.open(__FILE__)
|
98
105
|
end
|
99
106
|
end
|
@@ -125,9 +132,10 @@ end
|
|
125
132
|
|
126
133
|
class Class
|
127
134
|
def self.rubyqc
|
128
|
-
Object.constants.map{ |name|
|
129
|
-
|
130
|
-
|
135
|
+
Object.constants.map{ |name| # rubinius # jruby
|
136
|
+
if ![:BasicObject, :Class, :Config, :Data, :Autoload, :Continuation,
|
137
|
+
:RubyVM, :Struct, :WeakRef, :TracePoint].include?(name) &&
|
138
|
+
name !~ /Java/
|
131
139
|
const_get(name)
|
132
140
|
end
|
133
141
|
}.select{ |const| const.kind_of?(Class) }.sample
|
@@ -197,27 +205,27 @@ class Float
|
|
197
205
|
end
|
198
206
|
end
|
199
207
|
|
200
|
-
class
|
208
|
+
class Fiber
|
201
209
|
def self.rubyqc
|
202
|
-
new(
|
210
|
+
new(&Proc.rubyqc)
|
203
211
|
end
|
204
212
|
end
|
205
213
|
|
206
|
-
class
|
214
|
+
class Thread
|
207
215
|
def self.rubyqc
|
208
216
|
new(&Proc.rubyqc)
|
209
217
|
end
|
210
218
|
end
|
211
219
|
|
212
|
-
class
|
220
|
+
class SizedQueue
|
213
221
|
def self.rubyqc
|
214
|
-
new(
|
222
|
+
new(rand(1..100))
|
215
223
|
end
|
216
224
|
end
|
217
225
|
|
218
226
|
class SignalException
|
219
227
|
def self.rubyqc
|
220
|
-
new(rand(0..
|
228
|
+
new(rand(0..31))
|
221
229
|
end
|
222
230
|
end
|
223
231
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
require 'socket'
|
3
|
+
|
4
|
+
class Addrinfo
|
5
|
+
def self.rubyqc
|
6
|
+
Socket.ip_address_list.sample
|
7
|
+
end
|
8
|
+
end if Object.const_defined?(:Addrinfo) # rubinius does not have this class
|
9
|
+
|
10
|
+
class Socket
|
11
|
+
def self.rubyqc
|
12
|
+
for_fd(BasicSocket.rubyqc.fileno)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class BasicSocket
|
17
|
+
def self.rubyqc
|
18
|
+
[UNIXSocket, IPSocket].sample.rubyqc
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class IPSocket
|
23
|
+
def self.rubyqc
|
24
|
+
[TCPSocket, UDPSocket].sample.rubyqc
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class UNIXServer
|
29
|
+
def self.rubyqc
|
30
|
+
require 'tempfile'
|
31
|
+
tmp = Tempfile.new('sock')
|
32
|
+
path = tmp.path
|
33
|
+
tmp.close!
|
34
|
+
new(path)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class UNIXSocket
|
39
|
+
def self.rubyqc
|
40
|
+
new(UNIXServer.rubyqc.path)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class TCPServer
|
45
|
+
def self.rubyqc
|
46
|
+
new(0)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class TCPSocket
|
51
|
+
def self.rubyqc
|
52
|
+
new(*TCPServer.rubyqc.addr[1..2].reverse)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
class UDPSocket
|
57
|
+
def self.rubyqc
|
58
|
+
new
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require 'weakref'
|
3
|
+
|
4
|
+
# In MRI, WeakRef is a Delegator, so this is not really needed.
|
5
|
+
# But in Rubinius, WeakRef is not a Delegator, therefore we need
|
6
|
+
# to provide the exact same implementation here.
|
7
|
+
class WeakRef
|
8
|
+
def self.rubyqc
|
9
|
+
# Since Rubinius use BasicObject to implement WeakRef, it can't see
|
10
|
+
# Object::Class but ::Class.
|
11
|
+
new(::Class.rubyqc.rubyqc)
|
12
|
+
end
|
13
|
+
end
|
data/lib/rubyqc/version.rb
CHANGED
data/rubyqc.gemspec
CHANGED
@@ -1,27 +1,38 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: rubyqc 0.0.
|
2
|
+
# stub: rubyqc 0.0.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "rubyqc"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Lin Jen-Shin (godfat)"]
|
11
|
-
s.date = "2014-
|
11
|
+
s.date = "2014-04-18"
|
12
12
|
s.description = "RubyQC -- A conceptual [QuickCheck][] library for Ruby.\n\nIt's not a faithful port since Hsakell is totally different than Ruby.\nHowever it's still benefit to use some of the ideas behind QuickCheck,\nand we could also use RubyQC for generating arbitrary objects.\n\n[QuickCheck]: http://en.wikipedia.org/wiki/QuickCheck"
|
13
13
|
s.email = ["godfat (XD) godfat.org"]
|
14
14
|
s.files = [
|
15
15
|
".gitignore",
|
16
16
|
".gitmodules",
|
17
17
|
".travis.yml",
|
18
|
+
"CHANGES.md",
|
18
19
|
"Gemfile",
|
19
20
|
"LICENSE",
|
20
21
|
"README.md",
|
21
22
|
"Rakefile",
|
22
23
|
"lib/rubyqc.rb",
|
24
|
+
"lib/rubyqc/all.rb",
|
25
|
+
"lib/rubyqc/api.rb",
|
23
26
|
"lib/rubyqc/modifier.rb",
|
24
27
|
"lib/rubyqc/prelude.rb",
|
28
|
+
"lib/rubyqc/stdlib.rb",
|
29
|
+
"lib/rubyqc/stdlib/delegate.rb",
|
30
|
+
"lib/rubyqc/stdlib/pathname.rb",
|
31
|
+
"lib/rubyqc/stdlib/socket.rb",
|
32
|
+
"lib/rubyqc/stdlib/stringio.rb",
|
33
|
+
"lib/rubyqc/stdlib/strscan.rb",
|
34
|
+
"lib/rubyqc/stdlib/tempfile.rb",
|
35
|
+
"lib/rubyqc/stdlib/weakref.rb",
|
25
36
|
"lib/rubyqc/test.rb",
|
26
37
|
"lib/rubyqc/version.rb",
|
27
38
|
"rubyqc.gemspec",
|
@@ -32,7 +43,7 @@ Gem::Specification.new do |s|
|
|
32
43
|
"test/test_readme.rb"]
|
33
44
|
s.homepage = "https://github.com/godfat/rubyqc"
|
34
45
|
s.licenses = ["Apache License 2.0"]
|
35
|
-
s.rubygems_version = "2.2.
|
46
|
+
s.rubygems_version = "2.2.2"
|
36
47
|
s.summary = "RubyQC -- A conceptual [QuickCheck][] library for Ruby."
|
37
48
|
s.test_files = [
|
38
49
|
"test/test_api.rb",
|
data/test/test_api.rb
CHANGED
@@ -1,11 +1,57 @@
|
|
1
1
|
|
2
2
|
require 'rubyqc/test'
|
3
|
+
require 'rubyqc/all'
|
3
4
|
|
4
5
|
describe RubyQC::API do
|
5
|
-
should '
|
6
|
+
should 'oneof' do
|
6
7
|
check([Class]*5) do |klasses|
|
7
|
-
|
8
|
-
|
8
|
+
klasses -= [Should] # bacon's Should won't work...
|
9
|
+
check(oneof(*klasses)) do |obj|
|
10
|
+
begin
|
11
|
+
klasses.find{ |klass| obj.kind_of?(klass) }.should.not.nil
|
12
|
+
rescue => e
|
13
|
+
warn "Cannot find #{obj} in #{klasses}: #{e}"
|
14
|
+
raise
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'forall' do
|
21
|
+
should 'hard code' do
|
22
|
+
times = 0
|
23
|
+
forall([1,2], [3,4], [5,6]) do |a, b, c|
|
24
|
+
times += 1
|
25
|
+
[1,2].should.include a
|
26
|
+
[3,4].should.include b
|
27
|
+
[5,6].should.include c
|
28
|
+
end
|
29
|
+
times.should.eq 2**3
|
30
|
+
end
|
31
|
+
|
32
|
+
should 'check' do
|
33
|
+
check([Fixnum, Fixnum], [Fixnum, Fixnum], [Fixnum, Fixnum]) do |a, b, c|
|
34
|
+
times = 0
|
35
|
+
forall(a, b, c) do |aa, bb, cc|
|
36
|
+
times += 1
|
37
|
+
a.should.include aa
|
38
|
+
b.should.include bb
|
39
|
+
c.should.include cc
|
40
|
+
end
|
41
|
+
times.should.eq 2**3
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
should 'check check' do
|
46
|
+
check(1..5, 1..5) do |n, m|
|
47
|
+
check([[Fixnum]*n.abs]*m.abs) do |a|
|
48
|
+
times = 0
|
49
|
+
forall(*a) do |*aa|
|
50
|
+
times += 1
|
51
|
+
a.zip(aa).each{ |(b, bb)| b.should.include bb }
|
52
|
+
end
|
53
|
+
times.should.eq n**m
|
54
|
+
end
|
9
55
|
end
|
10
56
|
end
|
11
57
|
end
|
data/test/test_readme.rb
CHANGED
@@ -10,3 +10,38 @@ describe Array do
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
13
|
+
|
14
|
+
describe Hash do
|
15
|
+
describe 'compare_by_identity' do
|
16
|
+
should 'Treat diff arr with the same contents diff when set' do
|
17
|
+
arr = [0]
|
18
|
+
forall(booleans, [arr, [0]], [arr, [1]]) do |flag, a, b|
|
19
|
+
h = {}
|
20
|
+
h.compare_by_identity if flag
|
21
|
+
h[a] = h[b] = true
|
22
|
+
|
23
|
+
if (flag && a.object_id != b.object_id) || a != b
|
24
|
+
h.size.should.eq 2
|
25
|
+
else
|
26
|
+
h.size.should.eq 1
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class User < Struct.new(:id, :name)
|
34
|
+
def self.rubyqc
|
35
|
+
new(Fixnum.rubyqc, String.rubyqc)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'User.rubyqc' do
|
40
|
+
should 'Generate random users' do
|
41
|
+
check(User) do |user|
|
42
|
+
user .should.kind_of User
|
43
|
+
user.id .should.kind_of Fixnum
|
44
|
+
user.name.should.kind_of String
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyqc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lin Jen-Shin (godfat)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
RubyQC -- A conceptual [QuickCheck][] library for Ruby.
|
@@ -27,13 +27,24 @@ files:
|
|
27
27
|
- ".gitignore"
|
28
28
|
- ".gitmodules"
|
29
29
|
- ".travis.yml"
|
30
|
+
- CHANGES.md
|
30
31
|
- Gemfile
|
31
32
|
- LICENSE
|
32
33
|
- README.md
|
33
34
|
- Rakefile
|
34
35
|
- lib/rubyqc.rb
|
36
|
+
- lib/rubyqc/all.rb
|
37
|
+
- lib/rubyqc/api.rb
|
35
38
|
- lib/rubyqc/modifier.rb
|
36
39
|
- lib/rubyqc/prelude.rb
|
40
|
+
- lib/rubyqc/stdlib.rb
|
41
|
+
- lib/rubyqc/stdlib/delegate.rb
|
42
|
+
- lib/rubyqc/stdlib/pathname.rb
|
43
|
+
- lib/rubyqc/stdlib/socket.rb
|
44
|
+
- lib/rubyqc/stdlib/stringio.rb
|
45
|
+
- lib/rubyqc/stdlib/strscan.rb
|
46
|
+
- lib/rubyqc/stdlib/tempfile.rb
|
47
|
+
- lib/rubyqc/stdlib/weakref.rb
|
37
48
|
- lib/rubyqc/test.rb
|
38
49
|
- lib/rubyqc/version.rb
|
39
50
|
- rubyqc.gemspec
|
@@ -62,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
73
|
version: '0'
|
63
74
|
requirements: []
|
64
75
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.2.
|
76
|
+
rubygems_version: 2.2.2
|
66
77
|
signing_key:
|
67
78
|
specification_version: 4
|
68
79
|
summary: RubyQC -- A conceptual [QuickCheck][] library for Ruby.
|