mirage 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +2 -0
- data/README.md +11 -2
- data/Rakefile +4 -6
- data/VERSION +1 -1
- data/mirage.gemspec +3 -4
- data/spec/spec_helper.rb +46 -44
- metadata +19 -7
- data/todo.list +0 -0
data/HISTORY
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
V3.0.1 - updating gem post install message to point people towards the readme due checkout the differences between version 2 and 3 of Mirage
|
2
|
+
V3.0.0 - Major update see README.md
|
1
3
|
V2.4.2 - update eventmachine, make sure Mirage.start always returns a client
|
2
4
|
V2.4.1 - adding rdoc for configure method
|
3
5
|
V2.4.0 - Adding ability to set defaults
|
data/README.md
CHANGED
@@ -19,9 +19,13 @@ Installation
|
|
19
19
|
|
20
20
|
What's New?
|
21
21
|
-----------
|
22
|
-
### 3.0.0
|
22
|
+
### 3.0.0
|
23
23
|
------------------------------
|
24
|
-
3.0.0 is
|
24
|
+
3.0.0 is now out the following is a description of what's new.
|
25
|
+
|
26
|
+
A full description of the functionality is also available in the projects [feature files](https://github.com/lashd/mirage/wiki) hosted on Relish. A lot of effort has gone in to trying to make these tests readable so if something is missing or unclear drop me a line.
|
27
|
+
|
28
|
+
|
25
29
|
#### What's new in the Server:
|
26
30
|
##### 1: Mirage uses JSON as its communucations medium
|
27
31
|
Mirage is now configured using JSON. JSON is also used as the output format for Mirage's other operations.
|
@@ -46,6 +50,11 @@ Litteral matchers are worth more in the scoring process than regex based ones fo
|
|
46
50
|
Mirage is now accessible via: http://localhost:7001. I.e. 'mirage' has been removed from all resources
|
47
51
|
|
48
52
|
e.g. responses are now under http://localhost:7001/responses
|
53
|
+
##### 8. Default responses directory renamed to mirage
|
54
|
+
Default templates used to be stored in a directory named 'responses'. The term 'response' was the incorrect word to describe what is now called a 'template'. Rather than rename this directory to templates, which is a directory name that may already be in use in your project, the default name for this directory has been changed to 'mirage'.
|
55
|
+
|
56
|
+
The old directory name can still be used if you use the client or command line interface to overide where the responses are loaded from
|
57
|
+
|
49
58
|
#### What's new in the Client:
|
50
59
|
##### 1. Template Models
|
51
60
|
Perhaps the biggest addition to the client. Simply mixin Mirage::Template::Model in to a class, give it a method called body and there you have it... a class that can be used to put objects straight on to Mirage.
|
data/Rakefile
CHANGED
@@ -44,13 +44,11 @@ Jeweler::Tasks.new do |gem|
|
|
44
44
|
gem.executables = ['mirage']
|
45
45
|
gem.post_install_message = %{
|
46
46
|
===============================================================================
|
47
|
-
|
47
|
+
Mirage v3:
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
For more information go to: https://github.com/lashd/mirage/wiki
|
49
|
+
Mirage has just gone up a major version from 2 to 3. If you're project uses
|
50
|
+
a previous version take a look at https://github.com/lashd/mirage to see
|
51
|
+
what's changed
|
54
52
|
===============================================================================
|
55
53
|
}
|
56
54
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.1
|
data/mirage.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mirage"
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Leon Davis"]
|
12
|
-
s.date = "2013-10-
|
12
|
+
s.date = "2013-10-28"
|
13
13
|
s.description = "Mirage aids testing of your applications by hosting mock responses so that your applications do not have to talk to real endpoints. Its accessible via HTTP and has a RESTful interface."
|
14
14
|
s.executables = ["mirage"]
|
15
15
|
s.extra_rdoc_files = [
|
@@ -107,13 +107,12 @@ Gem::Specification.new do |s|
|
|
107
107
|
"spec/server/mock_response_spec.rb",
|
108
108
|
"spec/server/server_spec.rb",
|
109
109
|
"spec/spec_helper.rb",
|
110
|
-
"todo.list",
|
111
110
|
"views/index.haml",
|
112
111
|
"views/response.haml"
|
113
112
|
]
|
114
113
|
s.homepage = "https://github.com/lashd/mirage"
|
115
114
|
s.licenses = ["MIT"]
|
116
|
-
s.post_install_message = "\n===============================================================================\
|
115
|
+
s.post_install_message = "\n===============================================================================\nMirage v3:\n\nMirage has just gone up a major version from 2 to 3. If you're project uses\na previous version take a look at https://github.com/lashd/mirage to see\nwhat's changed\n===============================================================================\n"
|
117
116
|
s.require_paths = ["lib"]
|
118
117
|
s.rubygems_version = "1.8.25"
|
119
118
|
s.summary = "Mirage is a easy mock server for testing your applications"
|
data/spec/spec_helper.rb
CHANGED
@@ -16,68 +16,70 @@ end
|
|
16
16
|
RSpec.configure do |config|
|
17
17
|
include Mirage
|
18
18
|
config.include JsonHelpers
|
19
|
-
end
|
20
19
|
|
21
|
-
shared_context :windows do
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
shared_context :windows do
|
21
|
+
def process_string_for_mirage(mirage_port, pid)
|
22
|
+
%Q{ruby.exe #{pid} Console 1 6,076 K Running WIN-ATPGMMC0218\\\\leon 0:01:58 mirage server port #{mirage_port}}
|
23
|
+
end
|
25
24
|
|
26
|
-
|
27
|
-
|
25
|
+
before :each do
|
26
|
+
ChildProcess.stub(:windows?).and_return(true)
|
27
|
+
end
|
28
28
|
end
|
29
|
-
end
|
30
29
|
|
31
|
-
shared_context :linux do
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
shared_context :linux do
|
31
|
+
def process_string_for_mirage(mirage_port, pid)
|
32
|
+
"team #{pid} 6.2 0.4 84328 20760 pts/1 Sl 22:15 0:00 Mirage Server port #{mirage_port}"
|
33
|
+
end
|
35
34
|
|
36
|
-
|
37
|
-
|
35
|
+
before :each do
|
36
|
+
ChildProcess.stub(:windows?).and_return(false)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
shared_context :resources do
|
40
|
+
let(:resources_dir){"#{File.dirname(__FILE__)}/resources"}
|
38
41
|
end
|
39
|
-
end
|
40
|
-
shared_context :resources do
|
41
|
-
let(:resources_dir){"#{File.dirname(__FILE__)}/resources"}
|
42
|
-
end
|
43
42
|
|
44
|
-
shared_context :rack_test do |options|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
shared_context :rack_test do |options|
|
44
|
+
options = {:disable_sinatra_error_handling => false}.merge(options||{})
|
45
|
+
require 'sinatra'
|
46
|
+
require 'app'
|
47
|
+
require 'rack/test'
|
48
|
+
include Rack::Test::Methods
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
def app
|
51
|
+
@app_expectations ||= proc{}
|
52
|
+
Mirage::Server.new do |app|
|
53
|
+
@app_expectations.call app
|
54
|
+
end
|
55
55
|
end
|
56
|
-
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
def application_expectations &block
|
58
|
+
@app_expectations = proc do |app|
|
59
|
+
app.stub(:dup).and_return(app)
|
60
|
+
block.call app
|
61
|
+
end
|
62
62
|
end
|
63
|
-
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
if options[:disable_sinatra_error_handling]
|
65
|
+
module Mirage
|
66
|
+
class Server < Sinatra::Base
|
67
|
+
configure do
|
68
|
+
set :show_exceptions, false
|
69
|
+
end
|
70
70
|
end
|
71
71
|
end
|
72
|
-
end
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
73
|
+
module Sinatra
|
74
|
+
class Base
|
75
|
+
def handle_exception! boom
|
76
|
+
raise boom
|
77
|
+
end
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
+
|
85
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
@@ -336,15 +336,27 @@ files:
|
|
336
336
|
- spec/server/mock_response_spec.rb
|
337
337
|
- spec/server/server_spec.rb
|
338
338
|
- spec/spec_helper.rb
|
339
|
-
- todo.list
|
340
339
|
- views/index.haml
|
341
340
|
- views/response.haml
|
342
341
|
homepage: https://github.com/lashd/mirage
|
343
342
|
licenses:
|
344
343
|
- MIT
|
345
|
-
post_install_message: !
|
346
|
-
|
347
|
-
|
344
|
+
post_install_message: ! '
|
345
|
+
|
346
|
+
===============================================================================
|
347
|
+
|
348
|
+
Mirage v3:
|
349
|
+
|
350
|
+
|
351
|
+
Mirage has just gone up a major version from 2 to 3. If you''re project uses
|
352
|
+
|
353
|
+
a previous version take a look at https://github.com/lashd/mirage to see
|
354
|
+
|
355
|
+
what''s changed
|
356
|
+
|
357
|
+
===============================================================================
|
358
|
+
|
359
|
+
'
|
348
360
|
rdoc_options: []
|
349
361
|
require_paths:
|
350
362
|
- lib
|
@@ -356,7 +368,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
356
368
|
version: '0'
|
357
369
|
segments:
|
358
370
|
- 0
|
359
|
-
hash: -
|
371
|
+
hash: -3570325547630703443
|
360
372
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
361
373
|
none: false
|
362
374
|
requirements:
|
data/todo.list
DELETED
File without changes
|