-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
463 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# encoding: utf-8 | ||
SimpleCov.start do | ||
add_filter '/spec/' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
language: ruby | ||
rvm: | ||
- 2.0.0 | ||
- 2.1.0 | ||
- ruby-head | ||
- 2.0 | ||
- 2.1 | ||
- 2.2 | ||
- jruby | ||
- jruby-head | ||
- rbx-2 | ||
- rbx-head | ||
script: "bundle exec rspec spec" | ||
matrix: | ||
allow_failures: | ||
- rvm: ruby-head | ||
- rvm: jruby-head | ||
- rvm: rbx-head | ||
- rvm: rbx-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module RSpec | ||
module Sidekiq | ||
module Matchers | ||
def be_expired_in(expected_argument) | ||
BeExpiredIn.new(expected_argument) | ||
end | ||
|
||
class BeExpiredIn | ||
def initialize(expected_argument) | ||
@expected_argument = expected_argument | ||
end | ||
|
||
def description | ||
"to expire in #{@expected_argument}" | ||
end | ||
|
||
def failure_message | ||
"expected to expire in #{@expected_argument} but expired in #{@actual}" | ||
end | ||
|
||
def failure_message_when_negated | ||
"expected to not expire in #{@expected_argument}" | ||
end | ||
|
||
def matches?(job) | ||
@klass = job.is_a?(Class) ? job : job.class | ||
@actual = @klass.get_sidekiq_options['expires_in'] | ||
@actual.to_s == @expected_argument.to_s | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module RSpec | ||
module Sidekiq | ||
module Matchers | ||
def save_backtrace(expected_backtrace=true) | ||
SaveBacktrace.new expected_backtrace | ||
end | ||
|
||
class SaveBacktrace | ||
def initialize(expected_backtrace=true) | ||
@expected_backtrace = expected_backtrace | ||
end | ||
|
||
def description | ||
if @expected_backtrace.is_a?(Fixnum) | ||
"save #{@expected_backtrace} lines of error backtrace" # backtrace: 5 | ||
elsif @expected_backtrace | ||
'save error backtrace' # backtrace: true | ||
else | ||
'not save error backtrace' # backtrace: false | ||
end | ||
end | ||
|
||
def failure_message | ||
"expected #{@klass} to #{description} but got #{@actual}" | ||
end | ||
|
||
def matches?(job) | ||
@klass = job.is_a?(Class) ? job : job.class | ||
@actual = @klass.get_sidekiq_options['backtrace'] | ||
@actual == @expected_backtrace | ||
end | ||
|
||
def failure_message_when_negated | ||
"expected #{@klass} to not #{description}".gsub 'not not ', '' | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module RSpec | ||
module Sidekiq | ||
VERSION = '2.0.0' | ||
VERSION = '2.1.0' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.