subelsky_power_tools 1.2.6 → 1.2.7

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.
data/CHANGELOG CHANGED
@@ -1,7 +1,20 @@
1
+ v1.2.7
2
+ ======
3
+ * add custom ActiveRecord to_s method, useful for log messages
4
+ * add sidekiq assertions
5
+
1
6
  v1.2.6
2
7
  ======
3
- * Controller shared behavior can now test Rails controllers that use nested
4
- routes
8
+ * Controller shared behavior can now test Rails controllers that use nested routes
9
+
10
+ v1.2.5
11
+ ======
12
+ * allow some shared controller behavior specs to be skipped
13
+
14
+ v1.2.4
15
+ ======
16
+ * Fix gemset and gems
17
+ * Add shared controller behavior
5
18
 
6
19
  v1.2.3
7
20
  =====
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- subelsky_power_tools (1.2.6)
4
+ subelsky_power_tools (1.2.7)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/Rakefile CHANGED
@@ -15,6 +15,7 @@ task :release do
15
15
  `bundle`
16
16
  `git commit -ma "v#{SubelskyPowerTools::VERSION}"`
17
17
  `git tag '#{SubelskyPowerTools::VERSION}'`
18
+ `git push origin '#{SubelskyPowerTools::VERSION}'`
18
19
  `gem build subelsky_power_tools.gemspec`
19
20
  `gem push subelsky_power_tools-#{SubelskyPowerTools::VERSION}`
20
21
  end
@@ -0,0 +1,5 @@
1
+ class ActiveRecord::Base
2
+ def to_s
3
+ "#{self.class} #{self[:id]}"
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+ RSpec::Matchers.define :have_queued_job do |*expected|
2
+ match do |actual|
3
+ actual.jobs.any? { |job| job["args"] == Array(expected) }
4
+ end
5
+
6
+ failure_message_for_should do |actual|
7
+ "expected that #{actual} would have a job queued with #{expected}"
8
+ end
9
+
10
+ failure_message_for_should_not do |actual|
11
+ "expected that #{actual} would not a have a job queued with #{expected}"
12
+ end
13
+
14
+ description do
15
+ "have a job queued with #{expected}"
16
+ end
17
+ end
18
+
19
+ RSpec::Matchers.define :have_queued_job_at do |at,*expected|
20
+ match do |actual|
21
+ actual.jobs.any? { |job| job["args"] == Array(expected) && job["at"].to_i == at.to_i }
22
+ end
23
+
24
+ failure_message_for_should do |actual|
25
+ "expected that #{actual} would have a job queued with #{expected} at time #{at}"
26
+ end
27
+
28
+ failure_message_for_should_not do |actual|
29
+ "expected that #{actual} would not a have a job queued with #{expected} at time #{at}"
30
+ end
31
+
32
+ description do
33
+ "have a job queued with #{expected} at time #{at}"
34
+ end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module SubelskyPowerTools
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+
3
+ module ActiveRecord
4
+ class Base
5
+ def [](k)
6
+ return 50 if k == :id
7
+ end
8
+ end
9
+ end
10
+
11
+ require "subelsky_power_tools/ext/active_record"
12
+
13
+ describe ActiveRecord::Base do
14
+ Widget = Class.new(ActiveRecord::Base)
15
+ subject { Widget.new }
16
+
17
+ its(:to_s) { should eq("Widget 50") }
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subelsky_power_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-25 00:00:00.000000000 Z
12
+ date: 2013-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -49,12 +49,15 @@ files:
49
49
  - lib/subelsky_power_tools.rb
50
50
  - lib/subelsky_power_tools/controller_shared_behavior.rb
51
51
  - lib/subelsky_power_tools/environment.rb
52
+ - lib/subelsky_power_tools/ext/active_record.rb
52
53
  - lib/subelsky_power_tools/ext/exception.rb
53
54
  - lib/subelsky_power_tools/ext/hash.rb
54
55
  - lib/subelsky_power_tools/ext/kernel.rb
55
56
  - lib/subelsky_power_tools/page_load_assertions.rb
57
+ - lib/subelsky_power_tools/sidekiq_assertions.rb
56
58
  - lib/subelsky_power_tools/version.rb
57
59
  - spec/lib/environment_spec.rb
60
+ - spec/lib/ext/active_record_spec.rb
58
61
  - spec/lib/ext/exception_spec.rb
59
62
  - spec/lib/ext/hash_spec.rb
60
63
  - spec/lib/ext/kernel_spec.rb
@@ -82,14 +85,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
85
  version: '0'
83
86
  requirements: []
84
87
  rubyforge_project:
85
- rubygems_version: 1.8.23
88
+ rubygems_version: 1.8.24
86
89
  signing_key:
87
90
  specification_version: 3
88
91
  summary: This is a collection of Ruby extensions and utilities I've been carting around
89
92
  from project to project.
90
93
  test_files:
91
94
  - spec/lib/environment_spec.rb
95
+ - spec/lib/ext/active_record_spec.rb
92
96
  - spec/lib/ext/exception_spec.rb
93
97
  - spec/lib/ext/hash_spec.rb
94
98
  - spec/lib/ext/kernel_spec.rb
95
99
  - spec/spec_helper.rb
100
+ has_rdoc: