coast 0.9.6 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -10
- data/lib/coast/version.rb +1 -1
- data/test/test_coast.rb +26 -26
- metadata +10 -10
data/Gemfile.lock
CHANGED
@@ -1,26 +1,22 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (3.2.
|
4
|
+
activesupport (3.2.11)
|
5
5
|
i18n (~> 0.6)
|
6
6
|
multi_json (~> 1.0)
|
7
|
-
celluloid (0.12.3)
|
8
|
-
facter (>= 1.6.12)
|
9
|
-
timers (>= 1.0.0)
|
10
7
|
coderay (1.0.8)
|
11
|
-
facter (1.6.14)
|
12
8
|
i18n (0.6.1)
|
13
9
|
method_source (0.8.1)
|
14
|
-
micro_mock (0.
|
15
|
-
micro_test (0.3.
|
16
|
-
|
17
|
-
multi_json (1.
|
10
|
+
micro_mock (1.0.0)
|
11
|
+
micro_test (0.3.5)
|
12
|
+
os
|
13
|
+
multi_json (1.5.0)
|
14
|
+
os (0.9.6)
|
18
15
|
pry (0.9.10)
|
19
16
|
coderay (~> 1.0.5)
|
20
17
|
method_source (~> 0.8)
|
21
18
|
slop (~> 3.3.1)
|
22
19
|
slop (3.3.3)
|
23
|
-
timers (1.0.1)
|
24
20
|
|
25
21
|
PLATFORMS
|
26
22
|
ruby
|
data/lib/coast/version.rb
CHANGED
data/test/test_coast.rb
CHANGED
@@ -15,21 +15,21 @@ class TestCoast < MicroTest::Test
|
|
15
15
|
# Creates a mock model instance [ActiveRecord::Base].
|
16
16
|
def self.mock_model
|
17
17
|
mock = MicroMock.make.new
|
18
|
-
mock.
|
19
|
-
mock.
|
20
|
-
mock.
|
21
|
-
mock.
|
22
|
-
mock.class.
|
23
|
-
mock.class.
|
18
|
+
mock.def(:destroy) { @destroyed = true }
|
19
|
+
mock.def(:destroyed?) { @destroyed }
|
20
|
+
mock.def(:update_attributes) { |*args| @attributes_updated = true }
|
21
|
+
mock.def(:save) { |*args| @saved = true }
|
22
|
+
mock.class.def(:find) { |*args| TestCoast.mock_model }
|
23
|
+
mock.class.def(:all) { (1..5).map { TestCoast.mock_model } }
|
24
24
|
mock
|
25
25
|
end
|
26
26
|
|
27
27
|
# Creates a mock request instance [ActionDispatch::Request].
|
28
28
|
def self.mock_request
|
29
29
|
mock = MicroMock.make.new
|
30
|
-
mock.
|
31
|
-
mock.
|
32
|
-
mock.
|
30
|
+
mock.def(:request) { @request ||= MicroMock.make.new }
|
31
|
+
mock.def(:params) { @params ||= {} }
|
32
|
+
mock.def(:flash) { @flash ||= {} }
|
33
33
|
mock
|
34
34
|
end
|
35
35
|
|
@@ -37,29 +37,29 @@ class TestCoast < MicroTest::Test
|
|
37
37
|
def self.mock_controller
|
38
38
|
mock = MicroMock.make.new
|
39
39
|
mock.class.send :include, Coast
|
40
|
-
mock.
|
41
|
-
mock.
|
42
|
-
mock.
|
43
|
-
mock.
|
44
|
-
mock.
|
45
|
-
mock.
|
46
|
-
mock.
|
47
|
-
mock.
|
48
|
-
mock.
|
49
|
-
mock.
|
50
|
-
mock.
|
51
|
-
mock.
|
52
|
-
mock.
|
53
|
-
mock.
|
40
|
+
mock.def(:authorize!) { |*args| @authorize_invoked = true }
|
41
|
+
mock.def(:authorize_invoked?) { @authorize_invoked }
|
42
|
+
mock.def(:respond_to) { |&block| @responded = true; block.call(format) }
|
43
|
+
mock.def(:responded?) { @responded }
|
44
|
+
mock.def(:render) { |*args| @performed = @rendered = true }
|
45
|
+
mock.def(:performed?) { @performed }
|
46
|
+
mock.def(:rendered?) { @rendered }
|
47
|
+
mock.def(:redirect_to) { |*args| @redirected = true; render }
|
48
|
+
mock.def(:redirected?) { @redirected }
|
49
|
+
mock.def(:request) { @request ||= TestCoast.mock_request }
|
50
|
+
mock.def(:params) { request.params }
|
51
|
+
mock.def(:flash) { request.flash }
|
52
|
+
mock.def(:format) { @format ||= TestCoast.mock_format }
|
53
|
+
mock.def(:root_url) { "/" }
|
54
54
|
mock
|
55
55
|
end
|
56
56
|
|
57
57
|
# Creates a mock format instance [ActionController::MimeResponds::Collector].
|
58
58
|
def self.mock_format
|
59
59
|
mock = MicroMock.make.new
|
60
|
-
mock.
|
61
|
-
mock.
|
62
|
-
mock.
|
60
|
+
mock.def(:html) { |&block| @html = true; block.call if block }
|
61
|
+
mock.def(:xml) { |&block| @xml = true; block.call if block }
|
62
|
+
mock.def(:json) { |&block| @json = true; block.call if block }
|
63
63
|
mock
|
64
64
|
end
|
65
65
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
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:
|
12
|
+
date: 2013-01-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -32,33 +32,33 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.3
|
37
|
+
version: '0.3'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.3
|
45
|
+
version: '0.3'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: micro_mock
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: '1.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '1.0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: pry
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|