resque_unit_without_mock 0.1.0 → 0.1.2
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/.github/workflows/ruby.yml +33 -0
- data/Dockerfile +6 -0
- data/Gemfile.lock +28 -24
- data/README.md +7 -2
- data/docker-compose.yml +11 -0
- data/lib/resque_unit_without_mock/scheduler.rb +7 -2
- data/lib/resque_unit_without_mock/scheduler_assertions.rb +9 -3
- data/lib/resque_unit_without_mock/version.rb +1 -1
- data/resque_unit_without_mock.gemspec +5 -5
- metadata +23 -22
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0480a122f77d1d18286cb621fbeb409b98756bf1b73b03eee9797f7d0b34d50
|
4
|
+
data.tar.gz: 50f4fe0dee23957fc0564d72272d24d7422a58d0d651ea230247e5f3e34ca040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a5cff13ad9f68f3c72f9f64363665f1521f19d79c9008a843ea530e30f01b87a7349c3c5b4d885829c7cbcbefa85293fb7dd39bb5c74bc5f86b0bf685c83052
|
7
|
+
data.tar.gz: 28de5f6591a912e18faef29a8f2816213c4520f3b48e320d668e7daceadbb98213521ccf5fb64483dbd4df77e5b88057610bf23a50179733aca08e3136b1acfa
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
types:
|
9
|
+
- opened
|
10
|
+
- synchronize
|
11
|
+
- reopened
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
timeout-minutes: 5
|
17
|
+
strategy:
|
18
|
+
matrix:
|
19
|
+
ruby-version: ['2.7', '3.0', '3.1']
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v3
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby-version }}
|
26
|
+
bundler-cache: true
|
27
|
+
- name: Install Redis
|
28
|
+
run: sudo apt-get install -y redis-tools redis-server
|
29
|
+
- name: Verify that redis is up
|
30
|
+
run: redis-cli ping
|
31
|
+
- name: Run tests
|
32
|
+
run: |-
|
33
|
+
bundle exec rake
|
data/Dockerfile
ADDED
data/Gemfile.lock
CHANGED
@@ -1,49 +1,53 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
resque_unit_without_mock (0.1.
|
4
|
+
resque_unit_without_mock (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
9
|
+
connection_pool (2.3.0)
|
10
|
+
minitest (5.16.3)
|
10
11
|
minitest-hooks (1.5.0)
|
11
12
|
minitest (> 5.3)
|
12
|
-
mono_logger (1.1.
|
13
|
-
multi_json (1.
|
14
|
-
mustermann (
|
15
|
-
|
16
|
-
rack
|
13
|
+
mono_logger (1.1.1)
|
14
|
+
multi_json (1.15.0)
|
15
|
+
mustermann (3.0.0)
|
16
|
+
ruby2_keywords (~> 0.0.1)
|
17
|
+
rack (2.2.4)
|
18
|
+
rack-protection (3.0.3)
|
17
19
|
rack
|
18
|
-
rake (
|
19
|
-
redis (
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
rake (13.0.6)
|
21
|
+
redis (5.0.5)
|
22
|
+
redis-client (>= 0.9.0)
|
23
|
+
redis-client (0.11.2)
|
24
|
+
connection_pool
|
25
|
+
redis-namespace (1.9.0)
|
26
|
+
redis (>= 4)
|
27
|
+
resque (2.4.0)
|
23
28
|
mono_logger (~> 1.0)
|
24
29
|
multi_json (~> 1.0)
|
25
30
|
redis-namespace (~> 1.6)
|
26
31
|
sinatra (>= 0.9.2)
|
27
|
-
|
28
|
-
sinatra (
|
29
|
-
mustermann (~>
|
30
|
-
rack (~> 2.
|
31
|
-
rack-protection (=
|
32
|
+
ruby2_keywords (0.0.5)
|
33
|
+
sinatra (3.0.3)
|
34
|
+
mustermann (~> 3.0)
|
35
|
+
rack (~> 2.2, >= 2.2.4)
|
36
|
+
rack-protection (= 3.0.3)
|
32
37
|
tilt (~> 2.0)
|
33
|
-
tilt (2.0.
|
34
|
-
vegas (0.1.11)
|
35
|
-
rack (>= 1.0.0)
|
38
|
+
tilt (2.0.11)
|
36
39
|
|
37
40
|
PLATFORMS
|
38
41
|
ruby
|
42
|
+
x86_64-linux
|
39
43
|
|
40
44
|
DEPENDENCIES
|
41
|
-
bundler
|
42
|
-
minitest
|
45
|
+
bundler
|
46
|
+
minitest
|
43
47
|
minitest-hooks
|
44
|
-
rake
|
48
|
+
rake
|
45
49
|
resque
|
46
50
|
resque_unit_without_mock!
|
47
51
|
|
48
52
|
BUNDLED WITH
|
49
|
-
|
53
|
+
2.3.26
|
data/README.md
CHANGED
@@ -15,10 +15,10 @@ And then execute:
|
|
15
15
|
|
16
16
|
$ bundle
|
17
17
|
|
18
|
-
##
|
19
|
-
### resque_unitとの違い
|
18
|
+
## `resque_unit`との違い
|
20
19
|
resque_unitで提供していた `Resque.queues` は `Resque.queued` になっています。
|
21
20
|
|
21
|
+
## Usage
|
22
22
|
### `Resque.reset!` はプロジェクト内で再定義してください
|
23
23
|
専用のredis-serverプロセスを使っているなら `flushdb`でいいですが、
|
24
24
|
相乗りしているredis-serverの場合は https://gist.github.com/aserafin/6916037 みたいな感じで初期化するとよいでしょう。
|
@@ -35,6 +35,11 @@ end
|
|
35
35
|
Resque.singleton_class.prepend(ResqueHelpersExt)
|
36
36
|
```
|
37
37
|
|
38
|
+
## Development
|
39
|
+
* docker compose run --rm app bash
|
40
|
+
* bundle install
|
41
|
+
* bundle exec rake
|
42
|
+
|
38
43
|
## License
|
39
44
|
|
40
45
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/docker-compose.yml
ADDED
@@ -8,11 +8,16 @@ module ResqueUnitWithoutMock::Scheduler
|
|
8
8
|
# タイムスタンプを確認している.
|
9
9
|
# 実物Redisを使うにあたって同じ振る舞いにしたいのでクラス変数を使ってresque_unitと同じことを実現する.
|
10
10
|
def enqueue_at(timestamp, klass, *args)
|
11
|
-
|
11
|
+
enqueue_at_with_queue(
|
12
|
+
queue_for(klass), timestamp, klass, *args
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
def enqueue_at_with_queue(queue, timestamp, klass, *args)
|
12
17
|
@@enqueue_ats ||= {}
|
13
18
|
@@enqueue_ats[queue] ||= []
|
14
19
|
@@enqueue_ats[queue] << { timestamp: timestamp, klass: klass, args: args }
|
15
|
-
Resque.
|
20
|
+
Resque.enqueue_to(queue, klass, *args)
|
16
21
|
end
|
17
22
|
|
18
23
|
def enqueue_ats(queue)
|
@@ -1,6 +1,13 @@
|
|
1
1
|
module ResqueUnitWithoutMock::SchedulerAssertions
|
2
2
|
def assert_queued_at(expected_timestamp, klass)
|
3
|
-
|
3
|
+
assert_queued_at_with_queue(Resque.queue_for(klass), expected_timestamp, klass)
|
4
|
+
end
|
5
|
+
|
6
|
+
def assert_not_queued_at(expected_timestamp, klass)
|
7
|
+
assert_not_queued_at_with_queue(Resque.queue_for(klass), expected_timestamp, klass)
|
8
|
+
end
|
9
|
+
|
10
|
+
def assert_queued_at_with_queue(queue, expected_timestamp, klass)
|
4
11
|
result = Resque.enqueue_ats(queue).detect { |hash| hash[:timestamp] <= expected_timestamp && hash[:klass] == klass }
|
5
12
|
assert(
|
6
13
|
result,
|
@@ -8,8 +15,7 @@ module ResqueUnitWithoutMock::SchedulerAssertions
|
|
8
15
|
)
|
9
16
|
end
|
10
17
|
|
11
|
-
def
|
12
|
-
queue = Resque.queue_for(klass)
|
18
|
+
def assert_not_queued_at_with_queue(queue, expected_timestamp, klass)
|
13
19
|
result = Resque.enqueue_ats(queue).detect { |hash| hash[:timestamp] <= expected_timestamp && hash[:klass] == klass }
|
14
20
|
assert(
|
15
21
|
!result,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
lib = File.expand_path("../lib", __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require "resque_unit_without_mock/version"
|
@@ -11,8 +10,9 @@ Gem::Specification.new do |spec|
|
|
11
10
|
|
12
11
|
spec.summary = %q{resque_unit(without mock)}
|
13
12
|
spec.description = spec.summary
|
14
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.homepage = "https://github.com/ubiregiinc/resque_unit_without_mock"
|
15
14
|
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler"
|
27
|
-
spec.add_development_dependency "rake"
|
28
|
-
spec.add_development_dependency "minitest"
|
26
|
+
spec.add_development_dependency "bundler"
|
27
|
+
spec.add_development_dependency "rake"
|
28
|
+
spec.add_development_dependency "minitest"
|
29
29
|
spec.add_development_dependency "minitest-hooks"
|
30
30
|
spec.add_development_dependency "resque"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque_unit_without_mock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest-hooks
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,8 +87,9 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/ruby.yml"
|
90
91
|
- ".gitignore"
|
91
|
-
-
|
92
|
+
- Dockerfile
|
92
93
|
- Gemfile
|
93
94
|
- Gemfile.lock
|
94
95
|
- LICENSE.txt
|
@@ -96,6 +97,7 @@ files:
|
|
96
97
|
- Rakefile
|
97
98
|
- bin/console
|
98
99
|
- bin/setup
|
100
|
+
- docker-compose.yml
|
99
101
|
- lib/resque_unit_without_mock.rb
|
100
102
|
- lib/resque_unit_without_mock/resque_assertions.rb
|
101
103
|
- lib/resque_unit_without_mock/resque_helpers.rb
|
@@ -104,11 +106,11 @@ files:
|
|
104
106
|
- lib/resque_unit_without_mock/version.rb
|
105
107
|
- lib/resque_unit_without_mock_scheduler.rb
|
106
108
|
- resque_unit_without_mock.gemspec
|
107
|
-
homepage: https://github.com/
|
109
|
+
homepage: https://github.com/ubiregiinc/resque_unit_without_mock
|
108
110
|
licenses:
|
109
111
|
- MIT
|
110
112
|
metadata: {}
|
111
|
-
post_install_message:
|
113
|
+
post_install_message:
|
112
114
|
rdoc_options: []
|
113
115
|
require_paths:
|
114
116
|
- lib
|
@@ -116,16 +118,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
118
|
requirements:
|
117
119
|
- - ">="
|
118
120
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
121
|
+
version: 2.7.0
|
120
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
123
|
requirements:
|
122
124
|
- - ">="
|
123
125
|
- !ruby/object:Gem::Version
|
124
126
|
version: '0'
|
125
127
|
requirements: []
|
126
|
-
|
127
|
-
|
128
|
-
signing_key:
|
128
|
+
rubygems_version: 3.4.10
|
129
|
+
signing_key:
|
129
130
|
specification_version: 4
|
130
131
|
summary: resque_unit(without mock)
|
131
132
|
test_files: []
|