Low commit activity in last 3 years
No release in over a year
resque_unit(without mock)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 5.0
~> 10.0
>= 0
 Project Readme

ResqueUnitWithoutMock

現物redisにを使いながらresque_unitとほぼ同じIFのメソッドを提供するgemです。
このgemを使うと、resque_unitを使っていたけど実物redisを使うテストに切り替える時に既存テストをほぼ維持したまま移行が可能です。
minitestのみサポートしています。(please pull request for support rspec)

Installation

Add this line to your application's Gemfile:

gem 'resque_unit_without_mock', group: :test

And then execute:

$ bundle

resque_unitとの違い

resque_unitで提供していた Resque.queuesResque.queued になっています。

Usage

Resque.reset! はプロジェクト内で再定義してください

専用のredis-serverプロセスを使っているなら flushdbでいいですが、
相乗りしているredis-serverの場合は https://gist.github.com/aserafin/6916037 みたいな感じで初期化するとよいでしょう。

# example
module ResqueHelpersExt
  def reset!
    Resque.data_store.redis.select(ENV['TEST_ENV_NUMBER'].to_i + 1)
    Resque.data_store.redis.flushdb
    super
  end
end
Resque.singleton_class.prepend(ResqueHelpersExt)

License

The gem is available as open source under the terms of the MIT License.