Skip to content

Commit

Permalink
Reworks and improves testing
Browse files Browse the repository at this point in the history
  • Loading branch information
philostler committed May 15, 2013
1 parent 66167ac commit 5f53322
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 38 deletions.
38 changes: 0 additions & 38 deletions spec/rspec/sidekiq/be_processed_in_spec.rb

This file was deleted.

29 changes: 29 additions & 0 deletions spec/rspec/sidekiq/matchers/be_processed_in_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require "spec_helper"

describe "Be Processed In matcher" do
subject { TestWorker }

describe "expect syntax" do
context "when queue is specified as a string" do
it "correctly matches" do
expect(TestWorker).to be_processed_in "data"
end
end

context "when queue is specified as a symbol" do
it "correctly matches" do
expect(TestWorker).to be_processed_in :data
end
end
end

describe "one liner syntax" do
context "when queue is specified as a string" do
expect_it { to be_processed_in "data" }
end

context "when queue is specified as a symbol" do
expect_it { to be_processed_in :data }
end
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "sidekiq"
require "rspec-sidekiq"

require_relative "support/init"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
Coveralls::SimpleCov::Formatter,
SimpleCov::Formatter::HTMLFormatter
Expand Down
1 change: 1 addition & 0 deletions spec/support/init.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require_relative "test_worker"
8 changes: 8 additions & 0 deletions spec/support/test_worker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class TestWorker
include Sidekiq::Worker

sidekiq_options queue: :data

def perform
end
end

0 comments on commit 5f53322

Please sign in to comment.