http_stub 0.13.4 → 0.13.5

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: c4b66f83860993b5275ae09eb7d036184e0e19d0
4
- data.tar.gz: 3e7adaa3cf66591de7cd36ac147ef04f8ccbf6cb
3
+ metadata.gz: a55a4336aae9316c8d777ed41a0f0727a3e823f9
4
+ data.tar.gz: 1626c8d91fed1870ba6c4876e281a60efe06cb66
5
5
  SHA512:
6
- metadata.gz: bb06ac8af51c657cf65f26aa690a5c3007c6a8cd7716d4a2d2f38a69368fd71dfab30616a153fc542c05b0663c533b0bdff3520ca3e5b23013271515be631608
7
- data.tar.gz: 5b122f98db1a5e29e5e5e3bcb5cef521b9baab8c0b05cd9c5214eb5fd3af11b06e63f0475a0401172ba901d453be32aa418fe3315bac48236a43c1d06d33f867
6
+ metadata.gz: 5a9281b96bad47e690cf8ab42b73ae0da0a52200561a307aaa0e2ea16e0c1cc1e4998ddf9779d311aeb67fb968fd9ede7b4fe4169ffef26ca8c2c84d2157047b
7
+ data.tar.gz: 802e5b6711c1f8c3468210dc27e3c9a2cbd9e5f6670c20fdbd4a23a63621252059231ffe11a292f7939e8075db0c33e513536b076c8f5bb4d7b2f220178868e5
@@ -6,10 +6,7 @@ module HttpStub
6
6
  def initialize(args)
7
7
  namespace args[:name] do
8
8
  define_start_task(args)
9
- if args[:configurer]
10
- define_initialize_task(args)
11
- define_reset_task(args)
12
- end
9
+ define_initialize_task(args) if args[:configurer]
13
10
  end
14
11
  end
15
12
 
@@ -29,13 +26,11 @@ module HttpStub
29
26
  end
30
27
 
31
28
  def define_initialize_task(args)
32
- desc "Configures stub #{args[:name]}"
33
- task(:configure) { args[:configurer].initialize! }
34
- end
35
-
36
- def define_reset_task(args)
37
- desc "Resets stub #{args[:name]} to its configured state"
38
- task(:reset) { args[:configurer].reset! }
29
+ desc "Configures stub #{args[:name]} in its initial state"
30
+ task(:configure) do
31
+ args[:configurer].initialize!
32
+ args[:configurer].reset!
33
+ end
39
34
  end
40
35
 
41
36
  end
@@ -1,3 +1,3 @@
1
1
  module HttpStub
2
- VERSION = "0.13.4"
2
+ VERSION = "0.13.5"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  describe HttpStub::Rake::ServerTasks do
2
2
 
3
3
  let(:default_args) { { port: 8001 } }
4
- let(:configurer) { double(HttpStub::Configurer) }
4
+ let(:configurer) { double(HttpStub::Configurer).as_null_object }
5
5
 
6
6
  before(:each) { HttpStub::Rake::ServerTasks.new(default_args.merge(args)) }
7
7
 
@@ -19,35 +19,10 @@ describe HttpStub::Rake::ServerTasks do
19
19
  Rake::Task["configure_task_configurer_provided_test:configure"].execute
20
20
  end
21
21
 
22
- end
23
-
24
- end
25
-
26
- context "when a configurer is not provided" do
27
-
28
- let(:args) { { name: :configure_task_configurer_not_provided_test } }
29
-
30
- it "does not generate a task" do
31
- lambda { Rake::Task["configure_task_configurer_not_provided_test:configure"] }.should
32
- raise_error(/Don't know how to build task/)
33
- end
34
-
35
- end
36
-
37
- end
38
-
39
- describe "the reset task" do
40
-
41
- context "when a configurer is provided" do
42
-
43
- let(:args) { { name: :reset_task_configurer_provided_test, configurer: configurer } }
44
-
45
- context "and the task is executed" do
46
-
47
- it "resets the provided configurer" do
22
+ it "resets the provided configurer to ensure stubs are in their initial state" do
48
23
  configurer.should_receive(:reset!)
49
24
 
50
- Rake::Task["reset_task_configurer_provided_test:reset"].execute
25
+ Rake::Task["configure_task_configurer_provided_test:configure"].execute
51
26
  end
52
27
 
53
28
  end
@@ -56,10 +31,10 @@ describe HttpStub::Rake::ServerTasks do
56
31
 
57
32
  context "when a configurer is not provided" do
58
33
 
59
- let(:args) { { name: :reset_task_configurer_not_provided_test } }
34
+ let(:args) { { name: :configure_task_configurer_not_provided_test } }
60
35
 
61
36
  it "does not generate a task" do
62
- lambda { Rake::Task["reset_task_configurer_not_provided_test:reset"] }.should
37
+ lambda { Rake::Task["configure_task_configurer_not_provided_test:configure"] }.should
63
38
  raise_error(/Don't know how to build task/)
64
39
  end
65
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_stub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.4
4
+ version: 0.13.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ueckerman