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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbc742320b2d49ca1b0ccfb05d60c189212820f4
4
- data.tar.gz: d56e9a8c273902aedab09c984a1e7c17249dad03
3
+ metadata.gz: 7425cfbc4280a048b9281c1c719750a5bff03aef
4
+ data.tar.gz: f4760dd53c5a2b1923024ca0fc571d430743c784
5
5
  SHA512:
6
- metadata.gz: 1494635acd2c1106fe2309477866dcb3cb9782d4937144e1feaf0bf681cbb3197c051c6e56eb0fdf02cad15921a1afedb27c0b27db0cc5c2ce90c68718a0e81b
7
- data.tar.gz: 79b1b8d13c8b9bf5fbd23fa14d48cfc9ebe4972f69fea4ec4ef184524ef7a6f4e4a05b411c748d5e86ae4320778d0d89927ea679f202adc9a42e5c3343b3d22c
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
- expect(subject.full_name).to return("Dick Jones")
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
- expect(subject.title).to return("Vice President")
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
- expect(subject.full_name).to return("Dick Jones")
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
- expect(subject.join_names("Dick", "Jones")).to return("Dick Jones")
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
- expect(subject.#{spec[:method]}#{args_if_any(spec)}).to return(#{serialize spec[:returns]})
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 ', '})" : ""
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module Varys
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -1,6 +1,5 @@
1
1
  require 'rspec'
2
2
  require 'rspec/varys'
3
- require 'pry'
4
3
 
5
4
  class Person
6
5
 
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
1
 
2
- require 'pry'
3
2
  Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
4
3
  Dir.glob(::File.expand_path('../../lib/*.rb', __FILE__)).each { |f| require_relative f }
@@ -28,7 +28,9 @@ SPECS
28
28
  describe Person, "#full_name" do
29
29
 
30
30
  it "returns something" do
31
- expect(subject.full_name("Dick", "Jones")).to return("Dick Jones")
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
- expect(subject.full_name).to return("Dick Jones")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-varys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ritchie Young