rspec-varys 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/generating_specs.feature +12 -5
- data/lib/rspec/varys/rspec_generator.rb +8 -1
- data/lib/rspec/varys/version.rb +1 -1
- data/spec/rspec/varys_spec.rb +0 -1
- data/spec/spec_helper.rb +0 -1
- data/spec/varys/rspec_generator_spec.rb +6 -2
- 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: 7425cfbc4280a048b9281c1c719750a5bff03aef
|
4
|
+
data.tar.gz: f4760dd53c5a2b1923024ca0fc571d430743c784
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97a1b95809ae7fd39c2f4ed1b2a1fb9ab8e2ca3921cef1d322d96da1bdf16d9794b69d6ed28af090c8409244c338193ec457b4310a7ebea995e716ec4d04340b
|
7
|
+
data.tar.gz: 9518a21ae90dffdedb497bcdf9278ccfbfd4dc26a0c12e2e1cd862885482e972c93cecbe819702907b65327b291f474ebce69c226f066aac84284240949c8825
|
@@ -73,7 +73,9 @@ Feature: Generating an RSpec Spec from an RSpec Expectation
|
|
73
73
|
describe Person, "#full_name" do
|
74
74
|
|
75
75
|
it "returns something" do
|
76
|
-
|
76
|
+
confirm(subject).can receive(:full_name).and_return("Dick Jones")
|
77
|
+
skip "remove this line once implemented"
|
78
|
+
expect(subject.full_name).to eq("Dick Jones")
|
77
79
|
end
|
78
80
|
|
79
81
|
end
|
@@ -135,7 +137,9 @@ Feature: Generating an RSpec Spec from an RSpec Expectation
|
|
135
137
|
describe Person, "#title" do
|
136
138
|
|
137
139
|
it "returns something" do
|
138
|
-
|
140
|
+
confirm(subject).can receive(:title).and_return("Vice President")
|
141
|
+
skip "remove this line once implemented"
|
142
|
+
expect(subject.title).to eq("Vice President")
|
139
143
|
end
|
140
144
|
|
141
145
|
end
|
@@ -144,7 +148,9 @@ Feature: Generating an RSpec Spec from an RSpec Expectation
|
|
144
148
|
describe Person, "#full_name" do
|
145
149
|
|
146
150
|
it "returns something" do
|
147
|
-
|
151
|
+
confirm(subject).can receive(:full_name).and_return("Dick Jones")
|
152
|
+
skip "remove this line once implemented"
|
153
|
+
expect(subject.full_name).to eq("Dick Jones")
|
148
154
|
end
|
149
155
|
|
150
156
|
end
|
@@ -227,7 +233,6 @@ Feature: Generating an RSpec Spec from an RSpec Expectation
|
|
227
233
|
describe "#full_name" do
|
228
234
|
|
229
235
|
it "returns the correct value" do
|
230
|
-
confirm(subject).can receive(:full_name).and_return("Dick Jones")
|
231
236
|
expect(subject).to receive(:join_names).with("Dick", "Jones").and_return("Dick Jones")
|
232
237
|
subject.full_name
|
233
238
|
end
|
@@ -279,7 +284,9 @@ Feature: Generating an RSpec Spec from an RSpec Expectation
|
|
279
284
|
describe Person, "#join_names" do
|
280
285
|
|
281
286
|
it "returns something" do
|
282
|
-
|
287
|
+
confirm(subject).can receive(:join_names).with("Dick", "Jones").and_return("Dick Jones")
|
288
|
+
skip "remove this line once implemented"
|
289
|
+
expect(subject.join_names("Dick", "Jones")).to eq("Dick Jones")
|
283
290
|
end
|
284
291
|
|
285
292
|
end
|
@@ -16,7 +16,9 @@ class RSpec::Varys::RSpecGenerator
|
|
16
16
|
describe #{spec[:class_name]}, "##{spec[:method]}" do
|
17
17
|
|
18
18
|
it "returns something" do
|
19
|
-
|
19
|
+
confirm(subject).can receive(:#{spec[:method]})#{with_args_if_any(spec)}.and_return(#{serialize spec[:returns]})
|
20
|
+
skip "remove this line once implemented"
|
21
|
+
expect(subject.#{spec[:method]}#{args_if_any(spec)}).to eq(#{serialize spec[:returns]})
|
20
22
|
end
|
21
23
|
|
22
24
|
end
|
@@ -26,6 +28,11 @@ end
|
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
31
|
+
def self.with_args_if_any(call)
|
32
|
+
args = call[:arguments]
|
33
|
+
(args && args.length > 0) ? ".with(#{args.map{|a| serialize a}.join ', '})" : ""
|
34
|
+
end
|
35
|
+
|
29
36
|
def self.args_if_any(call)
|
30
37
|
args = call[:arguments]
|
31
38
|
(args && args.length > 0) ? "(#{args.map{|a| serialize a}.join ', '})" : ""
|
data/lib/rspec/varys/version.rb
CHANGED
data/spec/rspec/varys_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -28,7 +28,9 @@ SPECS
|
|
28
28
|
describe Person, "#full_name" do
|
29
29
|
|
30
30
|
it "returns something" do
|
31
|
-
|
31
|
+
confirm(subject).can receive(:full_name).with("Dick", "Jones").and_return("Dick Jones")
|
32
|
+
skip "remove this line once implemented"
|
33
|
+
expect(subject.full_name("Dick", "Jones")).to eq("Dick Jones")
|
32
34
|
end
|
33
35
|
|
34
36
|
end
|
@@ -59,7 +61,9 @@ SPECS
|
|
59
61
|
describe Person, "#full_name" do
|
60
62
|
|
61
63
|
it "returns something" do
|
62
|
-
|
64
|
+
confirm(subject).can receive(:full_name).and_return("Dick Jones")
|
65
|
+
skip "remove this line once implemented"
|
66
|
+
expect(subject.full_name).to eq("Dick Jones")
|
63
67
|
end
|
64
68
|
|
65
69
|
end
|