degenerate 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/degenerate/generators.rb +1 -1
- data/lib/degenerate/version.rb +1 -1
- data/spec/lib/generators_spec.rb +31 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 189d202cb0c1d62cccba415c7b341f5ac8b60b54
|
4
|
+
data.tar.gz: 6f93193b3e86426ae326fda56f7eaf0bdbc1540a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682ae687ce22337099b3c60c7baaf519a4311952dcf6ee9e33a7843032cfda907bbea4be1e5390f2ef55024543cc2ef468a2ad2fe387284181ef30dc3101fab1
|
7
|
+
data.tar.gz: 30580f4df11a74f56af152739f2f78f3ad791f4bd1b282d39427d2248af4af25fdd17b04504d9d9d0c0f6ebdd50c046bf27531544ae090921b39a004a7af2e36
|
data/lib/degenerate/version.rb
CHANGED
data/spec/lib/generators_spec.rb
CHANGED
@@ -98,4 +98,35 @@ RSpec.describe Degenerate::Generators do
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
101
|
+
|
102
|
+
describe "all generators" do
|
103
|
+
generative do
|
104
|
+
data(:with_arg) { generate(:any_with_arg) }
|
105
|
+
data(:without_arg) { generate(:any_without_arg) }
|
106
|
+
|
107
|
+
it "accepts an argument" do
|
108
|
+
expect { with_arg }.not_to raise_error
|
109
|
+
end
|
110
|
+
|
111
|
+
it "doesn't require an arg" do
|
112
|
+
expect { without_arg }.not_to raise_error
|
113
|
+
end
|
114
|
+
|
115
|
+
Generative.register_generator(:any_with_arg) do |_|
|
116
|
+
generator = Generative.manager.generators.keys.select { |g|
|
117
|
+
!g.to_s.match(/any/)
|
118
|
+
}.sample
|
119
|
+
|
120
|
+
Generative.find_and_call(generator, limit: 10)
|
121
|
+
end
|
122
|
+
|
123
|
+
Generative.register_generator(:any_without_arg) do |_|
|
124
|
+
generator = Generative.manager.generators.keys.select { |g|
|
125
|
+
!g.to_s.match(/any/)
|
126
|
+
}.sample
|
127
|
+
|
128
|
+
Generative.find_and_call(generator)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
101
132
|
end
|