mock-server-thin 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/lib/{mock_server.rb → mock_server_thin.rb} +2 -2
- data/test/mock_server_test.rb +4 -4
- metadata +6 -6
data/README.markdown
CHANGED
@@ -12,7 +12,7 @@ is to lay out an environment where your code can still run, connect to
|
|
12
12
|
a web server, send out requests and get responses back. Enter MockServer.
|
13
13
|
|
14
14
|
class RSSFeedTest < Test::Unit::TestCase
|
15
|
-
extend
|
15
|
+
extend MockServerThin::Methods
|
16
16
|
|
17
17
|
mock_server {
|
18
18
|
get "/feed.xml" do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "sinatra/base"
|
2
2
|
require "logger"
|
3
3
|
|
4
|
-
class
|
4
|
+
class MockServerThin
|
5
5
|
class App < Sinatra::Base
|
6
6
|
use Rack::ShowExceptions
|
7
7
|
end
|
@@ -27,7 +27,7 @@ class MockServer
|
|
27
27
|
def mock_server(*args, &block)
|
28
28
|
app = Class.new(Sinatra::Base)
|
29
29
|
app.class_eval(&block)
|
30
|
-
@server =
|
30
|
+
@server = MockServerThin.new(app, *args, &block).start
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
data/test/mock_server_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "mock_server_thin"))
|
2
2
|
|
3
3
|
require "test/unit"
|
4
4
|
require "ruby-debug"
|
@@ -12,7 +12,7 @@ end
|
|
12
12
|
|
13
13
|
class MockServerTest < Test::Unit::TestCase
|
14
14
|
def setup
|
15
|
-
@server =
|
15
|
+
@server = MockServerThin.new(HelloWorldSinatra)
|
16
16
|
@server.start
|
17
17
|
end
|
18
18
|
|
@@ -29,7 +29,7 @@ end
|
|
29
29
|
|
30
30
|
class MockServerRackBuilderTest < Test::Unit::TestCase
|
31
31
|
def setup
|
32
|
-
@server =
|
32
|
+
@server = MockServerThin.new(HelloWorldRackBuilder, 4001)
|
33
33
|
@server.start
|
34
34
|
end
|
35
35
|
|
@@ -38,7 +38,7 @@ class MockServerRackBuilderTest < Test::Unit::TestCase
|
|
38
38
|
end end
|
39
39
|
|
40
40
|
class MockServerMethodsTest < Test::Unit::TestCase
|
41
|
-
extend
|
41
|
+
extend MockServerThin::Methods
|
42
42
|
|
43
43
|
mock_server(4002) {
|
44
44
|
get "/" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock-server-thin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2011-11-18 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|
17
|
-
requirement: &
|
17
|
+
requirement: &2158204160 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2158204160
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: thin
|
28
|
-
requirement: &
|
28
|
+
requirement: &2158203160 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2158203160
|
37
37
|
description:
|
38
38
|
email:
|
39
39
|
- djanowski@dimaion.com
|
@@ -42,7 +42,7 @@ executables: []
|
|
42
42
|
extensions: []
|
43
43
|
extra_rdoc_files: []
|
44
44
|
files:
|
45
|
-
- lib/
|
45
|
+
- lib/mock_server_thin.rb
|
46
46
|
- README.markdown
|
47
47
|
- test/mock_server_test.rb
|
48
48
|
homepage: http://github.com/pote/mock-server-thin
|