warp 1.3.3 → 1.4.0

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -10
  3. data/Appraisals +2 -3
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +3 -5
  6. data/README.md +2 -3
  7. data/gemfiles/rails_3.2_rspec_3.0.gemfile +2 -6
  8. data/gemfiles/rails_3.2_rspec_3.1.gemfile +2 -6
  9. data/gemfiles/rails_3.2_rspec_3.2.gemfile +2 -6
  10. data/gemfiles/{rails_3.2_rspec_2.99.gemfile → rails_3.2_rspec_3.3.gemfile} +3 -7
  11. data/gemfiles/rails_4.0_rspec_3.0.gemfile +2 -6
  12. data/gemfiles/rails_4.0_rspec_3.1.gemfile +2 -6
  13. data/gemfiles/rails_4.0_rspec_3.2.gemfile +2 -6
  14. data/gemfiles/{rails_4.0_rspec_2.99.gemfile → rails_4.0_rspec_3.3.gemfile} +3 -7
  15. data/gemfiles/rails_4.1_rspec_3.0.gemfile +2 -6
  16. data/gemfiles/rails_4.1_rspec_3.1.gemfile +2 -6
  17. data/gemfiles/rails_4.1_rspec_3.2.gemfile +2 -6
  18. data/gemfiles/{rails_4.1_rspec_2.99.gemfile → rails_4.1_rspec_3.3.gemfile} +3 -7
  19. data/gemfiles/rails_4.2_rspec_3.0.gemfile +2 -6
  20. data/gemfiles/rails_4.2_rspec_3.1.gemfile +2 -6
  21. data/gemfiles/rails_4.2_rspec_3.2.gemfile +2 -6
  22. data/gemfiles/{rails_4.2_rspec_2.99.gemfile → rails_4.2_rspec_3.3.gemfile} +3 -7
  23. data/lib/warp/action_matchers/create_matcher.rb +6 -14
  24. data/lib/warp/action_matchers/destroy_matcher.rb +6 -14
  25. data/lib/warp/action_matchers/matcher.rb +7 -1
  26. data/lib/warp/action_matchers/update_matcher.rb +6 -14
  27. data/lib/warp/controller_matchers/assign_matcher.rb +127 -48
  28. data/lib/warp/instrument.rb +8 -26
  29. data/lib/warp/matcher.rb +2 -27
  30. data/lib/warp/version.rb +2 -2
  31. data/spec/spec_helper.rb +0 -11
  32. data/spec/warp/action_matchers/create_matcher_spec.rb +1 -1
  33. data/spec/warp/action_matchers/destroy_matcher_spec.rb +1 -1
  34. data/spec/warp/action_matchers/update_matcher_spec.rb +1 -1
  35. data/spec/warp/controller_matchers/assign_matcher_spec.rb +132 -88
  36. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 234f92d48b702feb43c71ce8c211f33c0687a378
4
- data.tar.gz: ca6886e9dc93730648b7a9452bd8a7b12c31df0d
3
+ metadata.gz: 3adb8eb57a1a07e3946d9a6509ab2c5b3c0f3a7c
4
+ data.tar.gz: 5bcbf3b706f9357ce933dbe0660df9e743250c51
5
5
  SHA512:
6
- metadata.gz: 6eba1f4a1659d02da2cf3bc157988d615451d382ded9de35301042aa0f360b32dffc3052d33815bfbfdba82eb956823a1fc092f00ebefb60da614c95f59afbba
7
- data.tar.gz: bff3a54600d2103708d7ce985a1bdd66c547392b07feb5570b8d2387653223e0f99be502939c9a02769c0ff752fc951d658bb98039849d1f78c9ec86bb02e588
6
+ metadata.gz: f78ea0011cfa93e17bde6342e458159a8db8ba06bee83befd6522e7473d2b09f7a2cef25a44245031ebbf7ee970c868755facf0d835c217d33dac08c875f17fe
7
+ data.tar.gz: aaeaeb5a5ed4101a166c4727a6bb2376d659744e65bebb7fcb028a58c57e2841a6a3b8e3320b6ad6209eb310991b53796da6b69b446505b5e491283b83ef87c7
data/.travis.yml CHANGED
@@ -6,32 +6,29 @@ env:
6
6
 
7
7
  rvm:
8
8
  - 1.9.3
9
+ - 2.0.0
10
+ - 2.1.5
9
11
  - 2.2.1
10
12
 
11
13
  gemfile:
12
- - gemfiles/rails_3.2_rspec_2.99.gemfile
13
14
  - gemfiles/rails_3.2_rspec_3.0.gemfile
14
15
  - gemfiles/rails_3.2_rspec_3.1.gemfile
15
16
  - gemfiles/rails_3.2_rspec_3.2.gemfile
16
- - gemfiles/rails_4.0_rspec_2.99.gemfile
17
+ - gemfiles/rails_3.2_rspec_3.3.gemfile
17
18
  - gemfiles/rails_4.0_rspec_3.0.gemfile
18
19
  - gemfiles/rails_4.0_rspec_3.1.gemfile
19
20
  - gemfiles/rails_4.0_rspec_3.2.gemfile
20
- - gemfiles/rails_4.1_rspec_2.99.gemfile
21
+ - gemfiles/rails_4.0_rspec_3.3.gemfile
21
22
  - gemfiles/rails_4.1_rspec_3.0.gemfile
22
23
  - gemfiles/rails_4.1_rspec_3.1.gemfile
23
24
  - gemfiles/rails_4.1_rspec_3.2.gemfile
24
- - gemfiles/rails_4.2_rspec_2.99.gemfile
25
+ - gemfiles/rails_4.1_rspec_3.3.gemfile
25
26
  - gemfiles/rails_4.2_rspec_3.0.gemfile
26
27
  - gemfiles/rails_4.2_rspec_3.1.gemfile
27
28
  - gemfiles/rails_4.2_rspec_3.2.gemfile
29
+ - gemfiles/rails_4.2_rspec_3.3.gemfile
28
30
 
29
-
31
+ before_install: gem update bundler
30
32
  bundler_args: --without tools
31
33
 
32
- before_install:
33
- - gem uninstall bundler
34
- - gem install bundler
35
-
36
-
37
34
  script: bundle exec rspec -b
data/Appraisals CHANGED
@@ -1,15 +1,14 @@
1
1
  ["3.2", "4.0", "4.1", "4.2"].each do |rails|
2
- ["2.99", "3.0", "3.1", "3.2"].each do |rspec|
2
+ ["3.0", "3.1", "3.2", "3.3"].each do |rspec|
3
3
  appraise "rails-#{rails}-rspec-#{rspec}" do
4
4
  rails_v = "~> #{rails}"
5
- rspec_v = "~> #{rspec}"
6
5
 
7
6
  gem "activesupport", rails_v, require: "active_support/all"
8
7
  gem "actionpack", rails_v, require: "action_controller"
9
8
  gem "activerecord", rails_v, require: "active_record"
10
9
  gem "actionview", rails_v, require: "action_view" if rails == "4.1"
11
10
 
12
- gem "rspec", rspec_v
11
+ gem "rspec", "~> #{rspec}"
13
12
  end
14
13
  end
15
14
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ - 1.4.0
2
+ - Dropped support for RSpec 2.
3
+ - Assignment matchers handle nil values better.
4
+ - Refactored assignment matchers.
5
+ - Refactored instrumentation.
6
+
1
7
  - 1.3.3
2
8
  - Added model update matcher.
3
9
 
data/Gemfile CHANGED
@@ -3,17 +3,15 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
6
+
7
+ gem "rake"
7
8
 
8
9
  gem "jamjar"
9
10
 
10
- gem "rake"
11
11
  gem "fuubar"
12
12
 
13
- gem "simplecov", require: false
14
- gem "coveralls", require: false
15
-
16
13
  group :tools do
14
+ gem "appraisal"
17
15
  gem "byebug", platform: [:ruby_20, :ruby_21, :ruby_22]
18
16
  gem "debugger", platform: :ruby_19
19
17
  end
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
- [![Build Status](https://img.shields.io/travis/thomasfedb/warp.svg?style=flat-square)](https://travis-ci.org/thomasfedb/warp)
2
- [![Coverage Status](https://img.shields.io/coveralls/thomasfedb/warp.svg?style=flat-square)](https://coveralls.io/r/thomasfedb/warp?branch=master)
3
1
  [![Gem Version](https://img.shields.io/gem/v/warp.svg?style=flat-square)](http://rubygems.org/gems/warp)
2
+ [![Build Status](https://img.shields.io/travis/thomasfedb/warp.svg?style=flat-square)](https://travis-ci.org/thomasfedb/warp)
4
3
  [![Code Climate](https://img.shields.io/codeclimate/github/thomasfedb/warp.svg?style=flat-square)](https://codeclimate.com/github/thomasfedb/warp)
5
4
 
6
5
  # Warp
@@ -12,7 +11,7 @@ Warp's matchers are written to be intuitive, easy to use, and to avoid testing R
12
11
  Compatible with:
13
12
  - Ruby 1.9.3 and greater
14
13
  - Rails 3.2 and greater
15
- - RSpec 2.99 and greater
14
+ - RSpec 3.0.0 and greater
16
15
 
17
16
  ## Installation
18
17
 
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 3.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 3.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 3.2", :require => "active_record"
15
12
  gem "rspec", "~> 3.0"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 3.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 3.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 3.2", :require => "active_record"
15
12
  gem "rspec", "~> 3.1"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 3.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 3.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 3.2", :require => "active_record"
15
12
  gem "rspec", "~> 3.2"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 3.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 3.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 3.2", :require => "active_record"
15
- gem "rspec", "~> 2.99"
12
+ gem "rspec", "~> 3.3"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.0", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.0", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.0", :require => "active_record"
15
12
  gem "rspec", "~> 3.0"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.0", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.0", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.0", :require => "active_record"
15
12
  gem "rspec", "~> 3.1"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.0", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.0", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.0", :require => "active_record"
15
12
  gem "rspec", "~> 3.2"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.0", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.0", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.0", :require => "active_record"
15
- gem "rspec", "~> 2.99"
12
+ gem "rspec", "~> 3.3"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,12 +3,9 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.1", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.1", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.1", :require => "active_record"
@@ -16,8 +13,7 @@ gem "actionview", "~> 4.1", :require => "action_view"
16
13
  gem "rspec", "~> 3.0"
17
14
 
18
15
  group :tools do
19
- gem "guard"
20
- gem "guard-rspec"
16
+ gem "appraisal"
21
17
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
22
18
  gem "debugger", :platform => :ruby_19
23
19
  end
@@ -3,12 +3,9 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.1", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.1", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.1", :require => "active_record"
@@ -16,8 +13,7 @@ gem "actionview", "~> 4.1", :require => "action_view"
16
13
  gem "rspec", "~> 3.1"
17
14
 
18
15
  group :tools do
19
- gem "guard"
20
- gem "guard-rspec"
16
+ gem "appraisal"
21
17
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
22
18
  gem "debugger", :platform => :ruby_19
23
19
  end
@@ -3,12 +3,9 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.1", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.1", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.1", :require => "active_record"
@@ -16,8 +13,7 @@ gem "actionview", "~> 4.1", :require => "action_view"
16
13
  gem "rspec", "~> 3.2"
17
14
 
18
15
  group :tools do
19
- gem "guard"
20
- gem "guard-rspec"
16
+ gem "appraisal"
21
17
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
22
18
  gem "debugger", :platform => :ruby_19
23
19
  end
@@ -3,21 +3,17 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.1", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.1", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.1", :require => "active_record"
15
12
  gem "actionview", "~> 4.1", :require => "action_view"
16
- gem "rspec", "~> 2.99"
13
+ gem "rspec", "~> 3.3"
17
14
 
18
15
  group :tools do
19
- gem "guard"
20
- gem "guard-rspec"
16
+ gem "appraisal"
21
17
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
22
18
  gem "debugger", :platform => :ruby_19
23
19
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.2", :require => "active_record"
15
12
  gem "rspec", "~> 3.0"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.2", :require => "active_record"
15
12
  gem "rspec", "~> 3.1"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.2", :require => "active_record"
15
12
  gem "rspec", "~> 3.2"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -3,20 +3,16 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "bundler"
6
- gem "appraisal"
7
- gem "jamjar"
8
6
  gem "rake"
7
+ gem "jamjar"
9
8
  gem "fuubar"
10
- gem "simplecov", :require => false
11
- gem "coveralls", :require => false
12
9
  gem "activesupport", "~> 4.2", :require => "active_support/all"
13
10
  gem "actionpack", "~> 4.2", :require => "action_controller"
14
11
  gem "activerecord", "~> 4.2", :require => "active_record"
15
- gem "rspec", "~> 2.99"
12
+ gem "rspec", "~> 3.3"
16
13
 
17
14
  group :tools do
18
- gem "guard"
19
- gem "guard-rspec"
15
+ gem "appraisal"
20
16
  gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
21
17
  gem "debugger", :platform => :ruby_19
22
18
  end
@@ -4,20 +4,6 @@ require "warp/instrument"
4
4
  module Warp
5
5
  module ActionMatchers
6
6
  class CreateMatcher < Warp::ActionMatchers::Matcher
7
- def self.instrument_method
8
- if ActiveRecord::Base.private_method_defined?(:_create_record)
9
- :_create_record
10
- else
11
- :create
12
- end
13
- end
14
-
15
- attr_reader :model
16
-
17
- def initialize(model)
18
- @model = model
19
- end
20
-
21
7
  def description
22
8
  "create a #{model_name}"
23
9
  end
@@ -29,6 +15,12 @@ module Warp
29
15
  def failure_message_when_negated
30
16
  "expected no #{model_name} to be created"
31
17
  end
18
+
19
+ private
20
+
21
+ def instrument_method
22
+ ActiveRecord::Base.private_method_defined?(:_create_record) ? :_create_record : :create
23
+ end
32
24
  end
33
25
 
34
26
  def create(model)
@@ -4,20 +4,6 @@ require "warp/instrument"
4
4
  module Warp
5
5
  module ActionMatchers
6
6
  class DestroyMatcher < Warp::ActionMatchers::Matcher
7
- def self.instrument_method
8
- if ActiveRecord::Base.private_method_defined?(:destroy_row)
9
- :destroy_row
10
- else
11
- :destroy
12
- end
13
- end
14
-
15
- attr_reader :model
16
-
17
- def initialize(model)
18
- @model = model
19
- end
20
-
21
7
  def description
22
8
  "destroy a #{model_name}"
23
9
  end
@@ -29,6 +15,12 @@ module Warp
29
15
  def failure_message_when_negated
30
16
  "expected no #{model_name} to be destroyed"
31
17
  end
18
+
19
+ private
20
+
21
+ def instrument_method
22
+ ActiveRecord::Base.private_method_defined?(:destroy_row) ? :destroy_row : :destroy
23
+ end
32
24
  end
33
25
 
34
26
  def destroy(model)
@@ -3,10 +3,16 @@ require "warp/matcher"
3
3
  module Warp
4
4
  module ActionMatchers
5
5
  class Matcher < Warp::Matcher
6
+ attr_reader :model
7
+
8
+ def initialize(model)
9
+ @model = model
10
+ end
11
+
6
12
  def matches?(actual)
7
13
  check_callable!(actual)
8
14
 
9
- instrument = Warp::Instrument.for(model, self.class.instrument_method)
15
+ instrument = Warp::Instrument.for(model, instrument_method)
10
16
 
11
17
  instrument.reset
12
18
  instrument.run { actual.call }
@@ -4,20 +4,6 @@ require "warp/instrument"
4
4
  module Warp
5
5
  module ActionMatchers
6
6
  class UpdateMatcher < Warp::ActionMatchers::Matcher
7
- def self.instrument_method
8
- if ActiveRecord::Base.private_method_defined?(:_create_record)
9
- :_update_record
10
- else
11
- :update
12
- end
13
- end
14
-
15
- attr_reader :model
16
-
17
- def initialize(model)
18
- @model = model
19
- end
20
-
21
7
  def description
22
8
  "update a #{model_name}"
23
9
  end
@@ -29,6 +15,12 @@ module Warp
29
15
  def failure_message_when_negated
30
16
  "expected no #{model_name} to be updated"
31
17
  end
18
+
19
+ private
20
+
21
+ def instrument_method
22
+ ActiveRecord::Base.private_method_defined?(:_update_record) ? :_update_record : :update
23
+ end
32
24
  end
33
25
 
34
26
  def update(model)