logux_rails 0.1.0 → 0.2.0
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/.travis.yml +1 -0
- data/Appraisals +4 -0
- data/CHANGELOG.md +13 -0
- data/Gemfile +3 -0
- data/README.md +7 -2
- data/app/helpers/logux_helper.rb +1 -2
- data/config/routes.rb +1 -1
- data/lib/logux/{actions.rb → action.rb} +1 -1
- data/lib/logux/model/proxy.rb +1 -1
- data/lib/logux/model/updates_deprecator.rb +12 -8
- data/lib/logux/version.rb +1 -1
- data/lib/logux_rails.rb +22 -1
- data/lib/tasks/logux_tasks.rake +10 -37
- data/logux_rails.gemspec +3 -6
- metadata +14 -77
- data/app/controllers/logux_controller.rb +0 -41
- data/lib/logux.rb +0 -107
- data/lib/logux/action_caller.rb +0 -42
- data/lib/logux/action_controller.rb +0 -6
- data/lib/logux/add.rb +0 -37
- data/lib/logux/auth.rb +0 -6
- data/lib/logux/base_controller.rb +0 -37
- data/lib/logux/channel_controller.rb +0 -24
- data/lib/logux/class_finder.rb +0 -61
- data/lib/logux/client.rb +0 -21
- data/lib/logux/error_renderer.rb +0 -40
- data/lib/logux/meta.rb +0 -36
- data/lib/logux/node.rb +0 -37
- data/lib/logux/policy.rb +0 -14
- data/lib/logux/policy_caller.rb +0 -34
- data/lib/logux/process.rb +0 -9
- data/lib/logux/process/action.rb +0 -60
- data/lib/logux/process/auth.rb +0 -27
- data/lib/logux/process/batch.rb +0 -59
- data/lib/logux/response.rb +0 -18
- data/lib/logux/stream.rb +0 -25
- data/lib/logux/test.rb +0 -35
- data/lib/logux/test/helpers.rb +0 -75
- data/lib/logux/test/matchers.rb +0 -10
- data/lib/logux/test/matchers/base.rb +0 -25
- data/lib/logux/test/matchers/response_chunks.rb +0 -48
- data/lib/logux/test/matchers/send_to_logux.rb +0 -51
- data/lib/logux/test/store.rb +0 -21
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base'
|
4
|
-
|
5
|
-
module Logux
|
6
|
-
module Test
|
7
|
-
module Matchers
|
8
|
-
class SendToLogux < Base
|
9
|
-
def matches?(actual)
|
10
|
-
@difference = state_changes_inside { actual.call }
|
11
|
-
return !@difference.empty? if expected.empty?
|
12
|
-
|
13
|
-
expected.all? do |ex|
|
14
|
-
@difference.find do |state|
|
15
|
-
state['commands'].any? do |c|
|
16
|
-
match_commands?(c, ex)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def failure_message
|
23
|
-
"expected that #{pretty(@difference)} to include "\
|
24
|
-
"commands #{pretty(expected)}"
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def state_changes_inside
|
30
|
-
before_state = Logux::Test::Store.instance.data.dup
|
31
|
-
yield
|
32
|
-
after_state = Logux::Test::Store.instance.data
|
33
|
-
|
34
|
-
(after_state - before_state).map { |d| JSON.parse(d) }
|
35
|
-
end
|
36
|
-
|
37
|
-
def match_commands?(stored_command, expected_command)
|
38
|
-
expected_command.each_with_index.all? do |part, index|
|
39
|
-
part.stringify_keys! if part.is_a?(Hash)
|
40
|
-
matcher = if part.is_a?(RSpec::Matchers::BuiltIn::BaseMatcher)
|
41
|
-
part
|
42
|
-
else
|
43
|
-
RSpec::Matchers::BuiltIn::Eq.new(part)
|
44
|
-
end
|
45
|
-
matcher.matches?(stored_command[index])
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
data/lib/logux/test/store.rb
DELETED