sidekiq-bus 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63074dbcb4a868908e6c6afc060f7e9bf0034434
4
- data.tar.gz: c2a5d5ac7044e6f3d9274eb36ec40b8c6d932847
3
+ metadata.gz: 383c736d2061345dd18d56c4233ecb21cb3c2982
4
+ data.tar.gz: d00dfd27a77c9257bba4d372a36414dfb606b296
5
5
  SHA512:
6
- metadata.gz: eda366027b1fb11e2075eaf541931f89a476900bc3389987443f181cfec655802cb7b906188100df98e1734da073a5e30fa8dbd49a9b016c78d2aefadeb3b538
7
- data.tar.gz: 4df1f834df6fc5de49b9f2a7acac151b100dd32d2e721d00448138692ffd9dc9dd90e819c760d9024cb456a978be10e39b238eb4488c74a248a7875c1e5ed444
6
+ metadata.gz: c1147633637d7d7843f287e1c03c2d3b0ba2e694dd9f8dde2548e989a1e0fb174bec79d6da35c1c8120be7dae6aa3290ad4a8af8de4208278110a97a1807e6f0
7
+ data.tar.gz: 8bf0056ba782b75594cdf337fdfafea8b7999241ccd3a1e2bd562dd9e470a1280533be9b60735b09492bcc9de931b38b2687d5fcc9f868008cf6d070be8dc5d1
@@ -1,3 +1,3 @@
1
1
  module SidekiqBus
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
data/sidekiq-bus.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency('queue-bus', '0.5.6')
21
+ s.add_dependency('queue-bus', '0.5.7')
22
22
  s.add_dependency('sidekiq', ['>= 3.0.0', '< 5.0'])
23
23
 
24
24
  s.add_development_dependency("rspec")
@@ -31,15 +31,15 @@ module QueueBus
31
31
  it "should raise an error if not valid" do
32
32
  lambda {
33
33
  Application.new("")
34
- }.should raise_error
34
+ }.should raise_error("Invalid application name")
35
35
 
36
36
  lambda {
37
37
  Application.new(nil)
38
- }.should raise_error
38
+ }.should raise_error("Invalid application name")
39
39
 
40
40
  lambda {
41
41
  Application.new("/")
42
- }.should raise_error
42
+ }.should raise_error("Invalid application name")
43
43
  end
44
44
  end
45
45
 
data/spec/config_spec.rb CHANGED
@@ -54,7 +54,7 @@ describe "QueueBus config" do
54
54
  # and should raise if already set
55
55
  lambda {
56
56
  QueueBus.adapter = :data
57
- }.should raise_error
57
+ }.should raise_error("Adapter already set to QueueBus::Adapters::Sidekiq")
58
58
  end
59
59
 
60
60
  context "with a fresh load" do
@@ -69,7 +69,7 @@ describe "QueueBus config" do
69
69
  # and should raise if already set
70
70
  lambda {
71
71
  QueueBus.adapter = :data
72
- }.should raise_error
72
+ }.should raise_error("Adapter already set to QueueBus::Adapters::Sidekiq")
73
73
  end
74
74
 
75
75
  it "should be able to be set to something else" do
@@ -1,11 +1,11 @@
1
- require 'spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  module QueueBus
4
4
  describe Dispatch do
5
5
  it "should not start with any applications" do
6
6
  Dispatch.new("d").subscriptions.size.should == 0
7
7
  end
8
-
8
+
9
9
  it "should register code to run and execute it" do
10
10
  dispatch = Dispatch.new("d")
11
11
  dispatch.subscribe("my_event") do |attrs|
@@ -18,15 +18,12 @@ module QueueBus
18
18
  dispatch.execute("my_event", {"bus_event_type" => "my_event", "ok" => true})
19
19
  Runner1.value.should == 1
20
20
  Runner1.attributes.should == {"bus_event_type" => "my_event", "ok" => true}
21
-
22
21
  end
23
-
22
+
24
23
  it "should not crash if not there" do
25
- lambda {
26
- Dispatch.new("d").execute("fdkjh", "bus_event_type" => "fdkjh")
27
- }.should_not raise_error
24
+ Dispatch.new("d").execute("fdkjh", "bus_event_type" => "fdkjh").should == nil
28
25
  end
29
-
26
+
30
27
  describe "Top Level" do
31
28
  before(:each) do
32
29
  QueueBus.dispatch("testit") do
@@ -41,13 +38,13 @@ module QueueBus
41
38
  high "event3" do
42
39
  Runner2.run({})
43
40
  end
44
-
41
+
45
42
  low /^patt.+ern/ do
46
43
  Runner.run({})
47
44
  end
48
45
  end
49
46
  end
50
-
47
+
51
48
  it "should register and run" do
52
49
  Runner2.value.should == 0
53
50
  QueueBus.dispatcher_execute("testit", "event2", "bus_event_type" => "event2")
@@ -57,7 +54,7 @@ module QueueBus
57
54
  QueueBus.dispatcher_execute("testit", "event1", "bus_event_type" => "event1")
58
55
  Runner2.value.should == 3
59
56
  end
60
-
57
+
61
58
  it "should return the subscriptions" do
62
59
  dispatcher = QueueBus.dispatcher_by_key("testit")
63
60
  subs = dispatcher.subscriptions.all
@@ -68,9 +65,8 @@ module QueueBus
68
65
  [ "(?-mix:^patt.+ern)", "testit_low"]
69
66
  ]
70
67
  end
71
-
68
+
72
69
  end
73
70
  end
74
71
 
75
72
  end
76
-
data/spec/worker_spec.rb CHANGED
@@ -16,9 +16,8 @@ module QueueBus
16
16
 
17
17
  it "should not freak out if class not there anymore" do
18
18
  hash = {"bus_class_proxy" => "QueueBus::BadClass", "ok" => true}
19
- lambda {
20
- QueueBus::Worker.perform(JSON.generate(hash))
21
- }.should_not raise_error
19
+
20
+ QueueBus::Worker.perform(JSON.generate(hash)).should == nil
22
21
  end
23
22
 
24
23
  it "should raise error if proxy raises error" do
@@ -26,7 +25,7 @@ module QueueBus
26
25
  QueueBus::Rider.should_receive(:perform).with(hash).and_raise("rider crash")
27
26
  lambda {
28
27
  QueueBus::Worker.perform(JSON.generate(hash))
29
- }.should raise_error
28
+ }.should raise_error("rider crash")
30
29
  end
31
30
  end
32
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Leonard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: queue-bus
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.6
19
+ version: 0.5.7
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.5.6
26
+ version: 0.5.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sidekiq
29
29
  requirement: !ruby/object:Gem::Requirement