pakyow-test 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pakyow-test/CHANGELOG.md +6 -0
- data/pakyow-test/lib/pakyow-test.rb +1 -60
- data/pakyow-test/lib/pakyow/test.rb +60 -0
- data/pakyow-test/lib/pakyow/test_help/ext/request.rb +11 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/ext/response.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/helpers.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/mocks/presenter_mock.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/mocks/status_mock.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/observable.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/observable_logger.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/observable_presenter.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/observable_view.rb +19 -3
- data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/realtime/observable_context.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/realtime/observable_mutator.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/simulation.rb +0 -0
- data/pakyow-test/lib/{test_help → pakyow/test_help}/simulator.rb +1 -4
- metadata +25 -25
- data/pakyow-test/lib/test_help/ext/request.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ecdd2b3ce34a9034aeac823abebe4c05090bb7f
|
4
|
+
data.tar.gz: c6258ed40f65758d29044cec62ec2dc00da46a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf649406966587c21c45baa68b5dfbd66239b6f1ad5f1b47947b2d5fc97d440843d3a246c85eb5004af4bbe5b9894d14ee4beaeb84e547145030578a48666fe
|
7
|
+
data.tar.gz: 3d0c453503a7c8d8af80589157c6898390cef1cb49b3856ceedf6dc04fdf34ca56776587319db46674531206c63dec621ca484d8d51eff7411d69e686d744a5b
|
data/pakyow-test/CHANGELOG.md
CHANGED
@@ -1,60 +1 @@
|
|
1
|
-
require 'pakyow
|
2
|
-
require 'pakyow-core'
|
3
|
-
require 'pakyow-presenter'
|
4
|
-
require 'pakyow-mailer'
|
5
|
-
require 'pakyow-realtime'
|
6
|
-
require 'pakyow-ui'
|
7
|
-
|
8
|
-
require_relative 'test_help/ext/request'
|
9
|
-
require_relative 'test_help/ext/response'
|
10
|
-
|
11
|
-
require_relative 'test_help/mocks/presenter_mock'
|
12
|
-
require_relative 'test_help/mocks/status_mock'
|
13
|
-
|
14
|
-
require_relative 'test_help/observables/observable_presenter'
|
15
|
-
require_relative 'test_help/observables/observable_view'
|
16
|
-
require_relative 'test_help/observables/observable_logger'
|
17
|
-
require_relative 'test_help/observables/realtime/observable_context'
|
18
|
-
require_relative 'test_help/observables/realtime/observable_mutator'
|
19
|
-
|
20
|
-
require_relative 'test_help/helpers'
|
21
|
-
require_relative 'test_help/simulator'
|
22
|
-
require_relative 'test_help/simulation'
|
23
|
-
|
24
|
-
module Pakyow
|
25
|
-
module TestHelp
|
26
|
-
def self.setup(path = './app/setup')
|
27
|
-
require path
|
28
|
-
|
29
|
-
Pakyow::App.after :match do
|
30
|
-
@presenter = Pakyow::TestHelp::ObservablePresenter.new(@presenter)
|
31
|
-
end
|
32
|
-
|
33
|
-
Pakyow::App.before :process do
|
34
|
-
Pakyow::TestHelp::Realtime::ObservableMutator.instance.reset
|
35
|
-
end
|
36
|
-
|
37
|
-
Pakyow::App.stage(ENV['TEST_ENV'] || :test)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
Pakyow::Presenter::ViewContext::VIEW_CLASSES << Pakyow::TestHelp::ObservableView
|
43
|
-
|
44
|
-
module Pakyow
|
45
|
-
module Helpers
|
46
|
-
def socket
|
47
|
-
@socket ||= Pakyow::TestHelp::Realtime::ObservableContext.new(app)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
module Pakyow
|
53
|
-
module Presenter
|
54
|
-
class ViewContext
|
55
|
-
def mutate(mutator, data: nil, with: nil)
|
56
|
-
Pakyow::TestHelp::Realtime::ObservableMutator.instance.mutate(mutator, self, data || with || [])
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
1
|
+
require 'pakyow/test'
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'pakyow/support'
|
2
|
+
require 'pakyow/core'
|
3
|
+
require 'pakyow/presenter'
|
4
|
+
require 'pakyow/mailer'
|
5
|
+
require 'pakyow/realtime'
|
6
|
+
require 'pakyow/ui'
|
7
|
+
|
8
|
+
require 'pakyow/test_help/ext/request'
|
9
|
+
require 'pakyow/test_help/ext/response'
|
10
|
+
|
11
|
+
require 'pakyow/test_help/mocks/presenter_mock'
|
12
|
+
require 'pakyow/test_help/mocks/status_mock'
|
13
|
+
|
14
|
+
require 'pakyow/test_help/observables/observable_presenter'
|
15
|
+
require 'pakyow/test_help/observables/observable_view'
|
16
|
+
require 'pakyow/test_help/observables/observable_logger'
|
17
|
+
require 'pakyow/test_help/observables/realtime/observable_context'
|
18
|
+
require 'pakyow/test_help/observables/realtime/observable_mutator'
|
19
|
+
|
20
|
+
require 'pakyow/test_help/helpers'
|
21
|
+
require 'pakyow/test_help/simulator'
|
22
|
+
require 'pakyow/test_help/simulation'
|
23
|
+
|
24
|
+
module Pakyow
|
25
|
+
module TestHelp
|
26
|
+
def self.setup(path = './app/setup')
|
27
|
+
require path
|
28
|
+
|
29
|
+
Pakyow::App.after :match do
|
30
|
+
@presenter = Pakyow::TestHelp::ObservablePresenter.new(@presenter)
|
31
|
+
end
|
32
|
+
|
33
|
+
Pakyow::App.before :process do
|
34
|
+
Pakyow::TestHelp::Realtime::ObservableMutator.instance.reset
|
35
|
+
end
|
36
|
+
|
37
|
+
Pakyow::App.stage(ENV['TEST_ENV'] || :test)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
Pakyow::Presenter::ViewContext::VIEW_CLASSES << Pakyow::TestHelp::ObservableView
|
43
|
+
|
44
|
+
module Pakyow
|
45
|
+
module Helpers
|
46
|
+
def socket
|
47
|
+
@socket ||= Pakyow::TestHelp::Realtime::ObservableContext.new(self)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
module Pakyow
|
53
|
+
module Presenter
|
54
|
+
class ViewContext
|
55
|
+
def mutate(mutator, data: nil, with: nil)
|
56
|
+
Pakyow::TestHelp::Realtime::ObservableMutator.instance.mutate(mutator, self, data || with || [])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -36,11 +36,21 @@ module Pakyow
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def bind(data, bindings: {}, context: nil, &block)
|
40
|
+
presenter.observing(view.scoped_as, :bind, traversal, data: data, bindings: bindings, context: context, block: block)
|
41
|
+
|
42
|
+
result = view.bind(data, bindings: bindings, context: context) do |view, datum|
|
43
|
+
block.call(handle_value(view), datum) unless block.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
handle_value(result)
|
47
|
+
end
|
48
|
+
|
39
49
|
def apply(data, bindings: {}, context: nil, &block)
|
40
50
|
presenter.observing(view.scoped_as, :apply, traversal, data: data, bindings: bindings, context: context, block: block)
|
41
51
|
|
42
52
|
result = view.apply(data, bindings: bindings, context: context) do |view, datum|
|
43
|
-
block.call(handle_value(view), datum)
|
53
|
+
block.call(handle_value(view), datum) unless block.nil?
|
44
54
|
end
|
45
55
|
|
46
56
|
handle_value(result)
|
@@ -89,8 +99,14 @@ module Pakyow
|
|
89
99
|
presenter.observed?(view.scoped_as, :apply, traversal, values)
|
90
100
|
end
|
91
101
|
|
92
|
-
def bound?(
|
93
|
-
view
|
102
|
+
def bound?(data = nil)
|
103
|
+
if view.first.doc.has_attribute?(:'data-scope')
|
104
|
+
values = {}
|
105
|
+
values[:data] = data if data
|
106
|
+
presenter.observed?(view.scoped_as, :bind, traversal, values)
|
107
|
+
else
|
108
|
+
data && (view.first.text == data || view.first.attrs.value.to_s == data)
|
109
|
+
end
|
94
110
|
end
|
95
111
|
|
96
112
|
def appended?(appended_view = nil)
|
data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/realtime/observable_context.rb
RENAMED
File without changes
|
data/pakyow-test/lib/{test_help → pakyow/test_help}/observables/realtime/observable_mutator.rb
RENAMED
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pakyow-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pakyow-support
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.11.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.11.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pakyow-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.11.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.11.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pakyow-presenter
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.11.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.11.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pakyow-mailer
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.11.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.11.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,19 +90,20 @@ files:
|
|
90
90
|
- pakyow-test/LICENSE
|
91
91
|
- pakyow-test/README.md
|
92
92
|
- pakyow-test/lib/pakyow-test.rb
|
93
|
-
- pakyow-test/lib/
|
94
|
-
- pakyow-test/lib/test_help/ext/
|
95
|
-
- pakyow-test/lib/test_help/
|
96
|
-
- pakyow-test/lib/test_help/
|
97
|
-
- pakyow-test/lib/test_help/mocks/
|
98
|
-
- pakyow-test/lib/test_help/
|
99
|
-
- pakyow-test/lib/test_help/
|
100
|
-
- pakyow-test/lib/test_help/observables/
|
101
|
-
- pakyow-test/lib/test_help/observables/
|
102
|
-
- pakyow-test/lib/test_help/observables/
|
103
|
-
- pakyow-test/lib/test_help/observables/realtime/
|
104
|
-
- pakyow-test/lib/test_help/
|
105
|
-
- pakyow-test/lib/test_help/
|
93
|
+
- pakyow-test/lib/pakyow/test.rb
|
94
|
+
- pakyow-test/lib/pakyow/test_help/ext/request.rb
|
95
|
+
- pakyow-test/lib/pakyow/test_help/ext/response.rb
|
96
|
+
- pakyow-test/lib/pakyow/test_help/helpers.rb
|
97
|
+
- pakyow-test/lib/pakyow/test_help/mocks/presenter_mock.rb
|
98
|
+
- pakyow-test/lib/pakyow/test_help/mocks/status_mock.rb
|
99
|
+
- pakyow-test/lib/pakyow/test_help/observable.rb
|
100
|
+
- pakyow-test/lib/pakyow/test_help/observables/observable_logger.rb
|
101
|
+
- pakyow-test/lib/pakyow/test_help/observables/observable_presenter.rb
|
102
|
+
- pakyow-test/lib/pakyow/test_help/observables/observable_view.rb
|
103
|
+
- pakyow-test/lib/pakyow/test_help/observables/realtime/observable_context.rb
|
104
|
+
- pakyow-test/lib/pakyow/test_help/observables/realtime/observable_mutator.rb
|
105
|
+
- pakyow-test/lib/pakyow/test_help/simulation.rb
|
106
|
+
- pakyow-test/lib/pakyow/test_help/simulator.rb
|
106
107
|
homepage: http://pakyow.org
|
107
108
|
licenses:
|
108
109
|
- MIT
|
@@ -123,9 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
124
|
version: '0'
|
124
125
|
requirements: []
|
125
126
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.5.1
|
127
128
|
signing_key:
|
128
129
|
specification_version: 4
|
129
130
|
summary: Pakyow Test
|
130
131
|
test_files: []
|
131
|
-
has_rdoc:
|