httpotemkin 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/CHANGELOG.md +11 -0
- data/bin/httpotemkin +3 -1
- data/httpotemkin.gemspec +3 -1
- data/lib/httpotemkin.rb +1 -0
- data/lib/test.rb +14 -0
- data/lib/version.rb +3 -0
- data/spec/integration/cli_spec.rb +6 -0
- data/spec/system/hello_world_spec.rb +43 -10
- data/yes_ship_it.conf +3 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a92d5f3c3c07552abf6abbff208200395c89cdef
|
4
|
+
data.tar.gz: 519d81c4e618655ddc91f7971d7d80fb3258e81a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7d91419dbf36b3a55f64dbc0968e14e496c0256fb3ae5b7ed4e1d8afce34ac0ff08f1b686ea239efe70a35e1a46c316dc7f82bbdb045dd8a049f27cf6ddcaf8
|
7
|
+
data.tar.gz: b130318a0db1552d3cab9946ef5cb46a7b78f7238bea060e35f2cc623b974940446805eff8dc8a86ccb65c1d151ef5d37e9ef00ab5746d5d91afe36faa3d9f00
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Change log of httpotemkin
|
2
|
+
|
3
|
+
## Version 0.0.2
|
4
|
+
|
5
|
+
* Support running servers and clients separate from executing the test. This
|
6
|
+
allows to share the same container instances between tests, where the state
|
7
|
+
of the container doesn't change between tests.
|
8
|
+
|
9
|
+
## Version 0.0.1
|
10
|
+
|
11
|
+
* Initial release
|
data/bin/httpotemkin
CHANGED
data/httpotemkin.gemspec
CHANGED
data/lib/httpotemkin.rb
CHANGED
data/lib/test.rb
CHANGED
@@ -19,5 +19,19 @@ module Httpotemkin
|
|
19
19
|
@containers.down
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
def up
|
24
|
+
@containers.up
|
25
|
+
end
|
26
|
+
|
27
|
+
def down
|
28
|
+
@containers.stop_client
|
29
|
+
@containers.down
|
30
|
+
end
|
31
|
+
|
32
|
+
def start_client
|
33
|
+
@containers.start_client
|
34
|
+
Client.new(@containers)
|
35
|
+
end
|
22
36
|
end
|
23
37
|
end
|
data/lib/version.rb
ADDED
@@ -23,6 +23,12 @@ Commands:
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
describe "version" do
|
27
|
+
it "shows version" do
|
28
|
+
expect(run_command(args: ["version"])).to exit_with_success("#{Httpotemkin::VERSION}\n")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
26
32
|
describe "status" do
|
27
33
|
it "shows status" do
|
28
34
|
with_stubbed_binary("bin/status/docker") do
|
@@ -1,20 +1,53 @@
|
|
1
1
|
require_relative "spec_helper"
|
2
2
|
|
3
3
|
describe "hello world" do
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
context "server started in test" do
|
5
|
+
it "answers" do
|
6
|
+
out = double
|
7
|
+
allow(out).to receive(:puts)
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
test = Httpotemkin::Test.new(out: out)
|
10
|
+
test.add_server("server")
|
10
11
|
|
11
|
-
|
12
|
+
test.run do |client|
|
13
|
+
sleep 2
|
14
|
+
client.execute(["curl", "server/hello"])
|
15
|
+
|
16
|
+
expect(client.exit_code).to eq(0)
|
17
|
+
expect(client.out).to eq("world\n")
|
18
|
+
expect(client.err.empty?).to be(true)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "server started before test" do
|
24
|
+
before(:all) do
|
25
|
+
out = StringIO.new
|
26
|
+
@test = Httpotemkin::Test.new(out: out)
|
27
|
+
@test.add_server("server")
|
28
|
+
@test.up
|
29
|
+
@client = @test.start_client
|
12
30
|
sleep 2
|
13
|
-
|
31
|
+
end
|
32
|
+
|
33
|
+
it "answers once" do
|
34
|
+
@client.execute(["curl", "server/hello"])
|
35
|
+
|
36
|
+
expect(@client.exit_code).to eq(0)
|
37
|
+
expect(@client.out).to eq("world\n")
|
38
|
+
expect(@client.err.empty?).to be(true)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "answers twice" do
|
42
|
+
@client.execute(["curl", "server/hello"])
|
43
|
+
|
44
|
+
expect(@client.exit_code).to eq(0)
|
45
|
+
expect(@client.out).to eq("world\n")
|
46
|
+
expect(@client.err.empty?).to be(true)
|
47
|
+
end
|
14
48
|
|
15
|
-
|
16
|
-
|
17
|
-
expect(client.err.empty?).to be(true)
|
49
|
+
after(:all) do
|
50
|
+
@test.down
|
18
51
|
end
|
19
52
|
end
|
20
53
|
end
|
data/yes_ship_it.conf
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpotemkin
|
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
|
- Cornelius Schumacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
78
|
- ".rspec"
|
79
|
+
- CHANGELOG.md
|
79
80
|
- CONTRIBUTING.md
|
80
81
|
- Gemfile
|
81
82
|
- MIT-LICENSE
|
@@ -107,6 +108,7 @@ files:
|
|
107
108
|
- lib/containers.rb
|
108
109
|
- lib/httpotemkin.rb
|
109
110
|
- lib/test.rb
|
111
|
+
- lib/version.rb
|
110
112
|
- logs/.gitignore
|
111
113
|
- spec/integration/bin/client/docker
|
112
114
|
- spec/integration/bin/down/docker
|
@@ -121,6 +123,7 @@ files:
|
|
121
123
|
- spec/system/data/test.tar.gz
|
122
124
|
- spec/system/hello_world_spec.rb
|
123
125
|
- spec/system/spec_helper.rb
|
126
|
+
- yes_ship_it.conf
|
124
127
|
homepage: https://github.com/cornelius/httpotemkin
|
125
128
|
licenses:
|
126
129
|
- MIT
|
@@ -141,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
144
|
version: 1.3.6
|
142
145
|
requirements: []
|
143
146
|
rubyforge_project: httpotemkin
|
144
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.4.5.1
|
145
148
|
signing_key:
|
146
149
|
specification_version: 4
|
147
150
|
summary: Mock HTTP services for system tests
|
148
151
|
test_files: []
|
149
|
-
has_rdoc:
|