assert_difference 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +17 -0
- data/Appraisals +21 -0
- data/CHANGELOG.md +33 -0
- data/Gemfile +2 -3
- data/README.md +60 -21
- data/Rakefile +8 -33
- data/assert_difference.gemspec +28 -18
- data/gemfiles/activesupport_3_0.gemfile +7 -0
- data/gemfiles/activesupport_3_0.gemfile.lock +69 -0
- data/gemfiles/activesupport_3_1.gemfile +7 -0
- data/gemfiles/activesupport_3_1.gemfile.lock +70 -0
- data/gemfiles/activesupport_3_2.gemfile +7 -0
- data/gemfiles/activesupport_3_2.gemfile.lock +72 -0
- data/gemfiles/activesupport_4_0.gemfile +7 -0
- data/gemfiles/activesupport_4_0.gemfile.lock +80 -0
- data/gemfiles/activesupport_4_1.gemfile +7 -0
- data/gemfiles/activesupport_4_1.gemfile.lock +79 -0
- data/lib/assert_difference.rb +50 -32
- data/lib/assert_difference/version.rb +6 -0
- data/test/assert_difference_test.rb +81 -0
- data/test/test_helper.rb +26 -0
- metadata +148 -24
- data/test/helper.rb +0 -11
- data/test/test_assert_difference.rb +0 -7
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b34e885247309d6118cead7f0a46ff70e3a64b79
|
4
|
+
data.tar.gz: d5eeac964ef12fcc60c4e4b2724773b30dc090e7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 57daed323e1d1ff3a16f7c4272ba567220c2dadb526211167d204bb8fa35b6b8445948516425fbfa653651703475979a7827ce1d901ea0aef37e441a7ec08d9a
|
7
|
+
data.tar.gz: bf9a480f6319c9a325d843d5f2e1b6480c5a9fc1540d263b5525d8a2a795130073d468e736a648c0f9f1b102c0a1451ae1ccdacae50605f73bf50dc71c67de4e
|
data/.travis.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- "1.9.3"
|
4
|
+
- "2.0.0"
|
5
|
+
- "2.1.1"
|
6
|
+
- "2.1.2"
|
7
|
+
- "2.1.3"
|
8
|
+
gemfile:
|
9
|
+
- gemfiles/activesupport_3_0.gemfile
|
10
|
+
- gemfiles/activesupport_3_1.gemfile
|
11
|
+
- gemfiles/activesupport_3_2.gemfile
|
12
|
+
- gemfiles/activesupport_4_0.gemfile
|
13
|
+
- gemfiles/activesupport_4_1.gemfile
|
14
|
+
addons:
|
15
|
+
code_climate:
|
16
|
+
repo_token:
|
17
|
+
secure: "drMasDnIxU1N0UN/0OvJI+nxaj6IsJsPnreodr2VxP2hCI2uHzybk78q5X7LnQVaPd8BBQiXLqmCx0KkyiTb1GbXO0kS992w4C4wbQBwraWs+Ifd18SCCUTCJ84zS3vgh62sHTv/LlLcPLo9yjkPfHYsprVgkK0HryEYNNmEhI4="
|
data/Appraisals
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright © 2014, Watu
|
2
|
+
|
3
|
+
appraise "activesupport-3_0" do
|
4
|
+
gem "activesupport", "~> 3.0.0"
|
5
|
+
end
|
6
|
+
|
7
|
+
appraise "activesupport-3_1" do
|
8
|
+
gem "activesupport", "~> 3.1.0"
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise "activesupport-3_2" do
|
12
|
+
gem "activesupport", "~> 3.2.0"
|
13
|
+
end
|
14
|
+
|
15
|
+
appraise "activesupport-4_0" do
|
16
|
+
gem "activesupport", "~> 4.0.0"
|
17
|
+
end
|
18
|
+
|
19
|
+
appraise "activesupport-4_1" do
|
20
|
+
gem "activesupport", "~> 4.1.0"
|
21
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
Authoritative changelog in README.md.
|
2
|
+
|
3
|
+
## Next version
|
4
|
+
- Modernization of the gem.
|
5
|
+
- Test with 100% code coverage.
|
6
|
+
- Started using Travis-CI for continuous testing.
|
7
|
+
- Started testing in various versions of active support and ruby.
|
8
|
+
- Improved documentation.
|
9
|
+
|
10
|
+
## Version 0.5.0 (Aug 6, 2012)
|
11
|
+
- Expectations can be ranges.
|
12
|
+
|
13
|
+
## Version 0.4.2 (Aug 6, 2012)
|
14
|
+
- Fixed important typo.
|
15
|
+
|
16
|
+
## Version 0.4.1 (Aug 6, 2012)
|
17
|
+
- Better error reporting (all unmatching counters).
|
18
|
+
|
19
|
+
## Version 0.4.0 (Feb 21, 2012)
|
20
|
+
- Fix crash on missing gems.
|
21
|
+
- Return what the blocks returns.
|
22
|
+
|
23
|
+
## Version 0.3.1 (Aug 25, 2011)
|
24
|
+
- Fixed documentation.
|
25
|
+
|
26
|
+
## Version 0.3.0 (Aug 24, 2011)
|
27
|
+
- Better organization of code with modules.
|
28
|
+
- Switched to bundler from jeweler.
|
29
|
+
- Removed unneeded dependencies.
|
30
|
+
- Cleaned up documentation.
|
31
|
+
|
32
|
+
## Version 0.1.0 (Oct 2, 2010)
|
33
|
+
- Initial release. Code extracted from a personal project.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,20 @@
|
|
1
|
-
assert_difference
|
2
|
-
=================
|
1
|
+
# assert_difference
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/pupeno/assert_difference.png?branch=master)](https://travis-ci.org/pupeno/assert_difference)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/pupeno/assert_difference/badge.png)](https://coveralls.io/r/pupeno/assert_difference)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/pupeno/assert_difference.png)](https://codeclimate.com/github/pupeno/assert_difference)
|
6
|
+
[![Test Coverage](https://codeclimate.com/github/pupeno/assert_difference/badges/coverage.svg)](https://codeclimate.com/github/pupeno/assert_difference)
|
7
|
+
[![Inline docs](http://inch-ci.org/github/pupeno/assert_difference.png)](http://inch-ci.org/github/pupeno/assert_difference)
|
8
|
+
[![Gem Version](https://badge.fury.io/rb/assert_difference.png)](http://badge.fury.io/rb/assert_difference)
|
9
|
+
[![Dependency Status](https://gemnasium.com/pupeno/assert_difference.svg)](https://gemnasium.com/pupeno/assert_difference)
|
10
|
+
|
11
|
+
A nice assert_difference method similar to the one provided by Rails but with some improvements. For example:
|
6
12
|
|
7
13
|
assert_difference "Company.count" => +1, "User.count" => +5, "Slot.count" => -1 do
|
8
14
|
post :something
|
9
15
|
end
|
10
16
|
|
11
|
-
will assert that a company and 5 users were create (the plus sign is only for
|
12
|
-
the visual aid) and a slot was removed.
|
17
|
+
will assert that a company and 5 users were create (the plus sign is only for the visual aid) and a slot was removed.
|
13
18
|
|
14
19
|
[Rails' assert_difference](http://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_difference)
|
15
20
|
would require a more verbose syntax:
|
@@ -28,7 +33,7 @@ Expectations can also be ranges, for example:
|
|
28
33
|
post :create
|
29
34
|
end
|
30
35
|
|
31
|
-
On top of that, error reporting is improved by displaying all the counters that didn't match
|
36
|
+
On top of that, error reporting is improved by displaying all the counters that didn't match.
|
32
37
|
|
33
38
|
To use it with Test::Unit add this code:
|
34
39
|
|
@@ -49,25 +54,59 @@ and to use it with RSpec:
|
|
49
54
|
config.include AssertDifference
|
50
55
|
end
|
51
56
|
|
52
|
-
|
57
|
+
This gem should work without Rails but it does depend on active support >= 3.0.0 and it's [tested with active support 3.0, 3.1, 3.2, 4.0 and 4.1 as well as Ruby 1.9.3, 2.0 and 2.1](https://travis-ci.org/pupeno/assert_difference).
|
58
|
+
|
59
|
+
## Users
|
60
|
+
|
61
|
+
This gem is being used by:
|
62
|
+
|
63
|
+
- [Watu](https://watuapp.com)
|
64
|
+
- You? please, let us know if you are using this gem.
|
65
|
+
|
66
|
+
## Changelog
|
67
|
+
|
68
|
+
### Next version
|
69
|
+
- Modernization of the gem.
|
70
|
+
- Test with 100% code coverage.
|
71
|
+
- Started using Travis-CI for continuous testing.
|
72
|
+
- Started testing in various versions of active support and ruby.
|
73
|
+
- Improved documentation.
|
74
|
+
|
75
|
+
### Version 0.5.0 (Aug 6, 2012)
|
76
|
+
- Expectations can be ranges.
|
77
|
+
|
78
|
+
### Version 0.4.2 (Aug 6, 2012)
|
79
|
+
- Fixed important typo.
|
80
|
+
|
81
|
+
### Version 0.4.1 (Aug 6, 2012)
|
82
|
+
- Better error reporting (all unmatching counters).
|
83
|
+
|
84
|
+
### Version 0.4.0 (Feb 21, 2012)
|
85
|
+
- Fix crash on missing gems.
|
86
|
+
- Return what the blocks returns.
|
87
|
+
|
88
|
+
### Version 0.3.1 (Aug 25, 2011)
|
89
|
+
- Fixed documentation.
|
90
|
+
|
91
|
+
### Version 0.3.0 (Aug 24, 2011)
|
92
|
+
- Better organization of code with modules.
|
93
|
+
- Switched to bundler from jeweler.
|
94
|
+
- Removed unneeded dependencies.
|
95
|
+
- Cleaned up documentation.
|
53
96
|
|
54
|
-
|
55
|
-
|
97
|
+
### Version 0.1.0 (Oct 2, 2010)
|
98
|
+
- Initial release. Code extracted from a personal project.
|
56
99
|
|
57
|
-
|
58
|
-
* Make your feature addition or bug fix.
|
59
|
-
* Add tests for it. This is important so I don't break it in a
|
60
|
-
future version unintentionally.
|
61
|
-
* Commit, do not mess with rakefile, version, or history.
|
62
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
63
|
-
* Send me a pull request. Bonus points for topic branches.
|
64
|
-
* Document any new options and verify the documentation looks correct by running:
|
100
|
+
## Contributing
|
65
101
|
|
66
|
-
|
102
|
+
1. Fork it
|
103
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
104
|
+
3. Commit your changes (`git commit -am "Add some feature"`)
|
105
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
106
|
+
5. Create new Pull Request
|
67
107
|
|
68
|
-
and going to http://localhost:8808
|
69
108
|
|
70
109
|
Copyright
|
71
110
|
---------
|
72
111
|
|
73
|
-
Copyright (c) 2010, 2011, 2012 José Pablo Fernández. See LICENSE for details.
|
112
|
+
Copyright (c) 2010, 2011, 2012, 2014 José Pablo Fernández. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -1,39 +1,14 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2011, José Pablo Fernández
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Copyright © 2011, 2014 José Pablo Fernández
|
3
3
|
|
4
|
-
require "
|
5
|
-
require "
|
4
|
+
require "rubygems"
|
5
|
+
require "bundler/setup"
|
6
6
|
require "bundler/gem_tasks"
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
desc "Test the table_builder plugin."
|
12
|
-
Rake::TestTask.new(:test) do |t|
|
8
|
+
require "rake/testtask"
|
9
|
+
Rake::TestTask.new do |t|
|
13
10
|
t.libs << "lib"
|
14
|
-
t.
|
15
|
-
t.verbose = true
|
11
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
16
12
|
end
|
17
13
|
|
18
|
-
|
19
|
-
require "rcov/rcovtask"
|
20
|
-
Rcov::RcovTask.new do |test|
|
21
|
-
test.libs << "test"
|
22
|
-
test.pattern = "test/**/test_*.rb"
|
23
|
-
test.verbose = true
|
24
|
-
end
|
25
|
-
rescue LoadError => e
|
26
|
-
puts "rcov is not installed, oh well"
|
27
|
-
end
|
28
|
-
|
29
|
-
begin
|
30
|
-
require "yard"
|
31
|
-
YARD::Rake::YardocTask.new do |yard|
|
32
|
-
# Use Markdown for documentation.
|
33
|
-
yard.options << "--markup" << "markdown"
|
34
|
-
# Extra file(s).
|
35
|
-
yard.options << "-" << "LICENSE"
|
36
|
-
end
|
37
|
-
rescue LoadError => e
|
38
|
-
puts "yard is not installed, oh well"
|
39
|
-
end
|
14
|
+
task :default => :test
|
data/assert_difference.gemspec
CHANGED
@@ -1,24 +1,34 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2011, José Pablo Fernández
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Copyright © 2011, 2014 José Pablo Fernández
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
lib = File.expand_path("../lib", __FILE__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
require "assert_difference/version"
|
6
7
|
|
7
|
-
Gem::Specification.new do |
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = "assert_difference"
|
10
|
+
spec.version = AssertDifference::VERSION
|
11
|
+
spec.authors = ["J. Pablo Fernández"]
|
12
|
+
spec.email = ["pupeno@pupeno.com"]
|
13
|
+
spec.homepage = "https://github.com/pupeno/assert_difference"
|
14
|
+
spec.summary = "Like Rails' assert_difference, but more powerful"
|
15
|
+
spec.description = "Like Rails' assert_difference, but more compact and readable syntax through hashes, testing ranges and improved error reporting."
|
16
|
+
spec.license = "MIT"
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
spec.files = `git ls-files`.split($/)
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ["lib"]
|
19
22
|
|
20
|
-
|
23
|
+
spec.required_ruby_version = ">= 1.9.3"
|
24
|
+
spec.add_dependency "activesupport", ">= 3.0.0"
|
21
25
|
|
22
|
-
|
23
|
-
|
26
|
+
spec.add_development_dependency "appraisal"
|
27
|
+
spec.add_development_dependency "bundler"
|
28
|
+
spec.add_development_dependency "codeclimate-test-reporter"
|
29
|
+
spec.add_development_dependency "coveralls" #, require: false
|
30
|
+
spec.add_development_dependency "minitest"
|
31
|
+
spec.add_development_dependency "minitest-reporters"
|
32
|
+
spec.add_development_dependency "rake"
|
33
|
+
spec.add_development_dependency "shoulda"
|
24
34
|
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
assert_difference (0.5.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (3.0.20)
|
11
|
+
ansi (1.4.3)
|
12
|
+
appraisal (1.0.2)
|
13
|
+
bundler
|
14
|
+
rake
|
15
|
+
thor (>= 0.14.0)
|
16
|
+
builder (3.2.2)
|
17
|
+
codeclimate-test-reporter (0.4.1)
|
18
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
19
|
+
coveralls (0.7.1)
|
20
|
+
multi_json (~> 1.3)
|
21
|
+
rest-client
|
22
|
+
simplecov (>= 0.7)
|
23
|
+
term-ansicolor
|
24
|
+
thor
|
25
|
+
docile (1.1.5)
|
26
|
+
mime-types (2.4.3)
|
27
|
+
minitest (5.4.3)
|
28
|
+
minitest-reporters (1.0.7)
|
29
|
+
ansi
|
30
|
+
builder
|
31
|
+
minitest (>= 5.0)
|
32
|
+
ruby-progressbar
|
33
|
+
multi_json (1.10.1)
|
34
|
+
netrc (0.8.0)
|
35
|
+
rake (10.3.2)
|
36
|
+
rest-client (1.7.2)
|
37
|
+
mime-types (>= 1.16, < 3.0)
|
38
|
+
netrc (~> 0.7)
|
39
|
+
ruby-progressbar (1.7.0)
|
40
|
+
shoulda (3.5.0)
|
41
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
42
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
43
|
+
shoulda-context (1.2.1)
|
44
|
+
shoulda-matchers (2.7.0)
|
45
|
+
activesupport (>= 3.0.0)
|
46
|
+
simplecov (0.9.1)
|
47
|
+
docile (~> 1.1.0)
|
48
|
+
multi_json (~> 1.0)
|
49
|
+
simplecov-html (~> 0.8.0)
|
50
|
+
simplecov-html (0.8.0)
|
51
|
+
term-ansicolor (1.3.0)
|
52
|
+
tins (~> 1.0)
|
53
|
+
thor (0.19.1)
|
54
|
+
tins (1.3.3)
|
55
|
+
|
56
|
+
PLATFORMS
|
57
|
+
ruby
|
58
|
+
|
59
|
+
DEPENDENCIES
|
60
|
+
activesupport (~> 3.0.0)
|
61
|
+
appraisal
|
62
|
+
assert_difference!
|
63
|
+
bundler
|
64
|
+
codeclimate-test-reporter
|
65
|
+
coveralls
|
66
|
+
minitest
|
67
|
+
minitest-reporters
|
68
|
+
rake
|
69
|
+
shoulda
|
@@ -0,0 +1,70 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
assert_difference (0.5.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (3.1.12)
|
11
|
+
multi_json (~> 1.0)
|
12
|
+
ansi (1.4.3)
|
13
|
+
appraisal (1.0.2)
|
14
|
+
bundler
|
15
|
+
rake
|
16
|
+
thor (>= 0.14.0)
|
17
|
+
builder (3.2.2)
|
18
|
+
codeclimate-test-reporter (0.4.1)
|
19
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
20
|
+
coveralls (0.7.1)
|
21
|
+
multi_json (~> 1.3)
|
22
|
+
rest-client
|
23
|
+
simplecov (>= 0.7)
|
24
|
+
term-ansicolor
|
25
|
+
thor
|
26
|
+
docile (1.1.5)
|
27
|
+
mime-types (2.4.3)
|
28
|
+
minitest (5.4.3)
|
29
|
+
minitest-reporters (1.0.7)
|
30
|
+
ansi
|
31
|
+
builder
|
32
|
+
minitest (>= 5.0)
|
33
|
+
ruby-progressbar
|
34
|
+
multi_json (1.10.1)
|
35
|
+
netrc (0.8.0)
|
36
|
+
rake (10.3.2)
|
37
|
+
rest-client (1.7.2)
|
38
|
+
mime-types (>= 1.16, < 3.0)
|
39
|
+
netrc (~> 0.7)
|
40
|
+
ruby-progressbar (1.7.0)
|
41
|
+
shoulda (3.5.0)
|
42
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
43
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
44
|
+
shoulda-context (1.2.1)
|
45
|
+
shoulda-matchers (2.7.0)
|
46
|
+
activesupport (>= 3.0.0)
|
47
|
+
simplecov (0.9.1)
|
48
|
+
docile (~> 1.1.0)
|
49
|
+
multi_json (~> 1.0)
|
50
|
+
simplecov-html (~> 0.8.0)
|
51
|
+
simplecov-html (0.8.0)
|
52
|
+
term-ansicolor (1.3.0)
|
53
|
+
tins (~> 1.0)
|
54
|
+
thor (0.19.1)
|
55
|
+
tins (1.3.3)
|
56
|
+
|
57
|
+
PLATFORMS
|
58
|
+
ruby
|
59
|
+
|
60
|
+
DEPENDENCIES
|
61
|
+
activesupport (~> 3.1.0)
|
62
|
+
appraisal
|
63
|
+
assert_difference!
|
64
|
+
bundler
|
65
|
+
codeclimate-test-reporter
|
66
|
+
coveralls
|
67
|
+
minitest
|
68
|
+
minitest-reporters
|
69
|
+
rake
|
70
|
+
shoulda
|
@@ -0,0 +1,72 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
assert_difference (0.5.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (3.2.19)
|
11
|
+
i18n (~> 0.6, >= 0.6.4)
|
12
|
+
multi_json (~> 1.0)
|
13
|
+
ansi (1.4.3)
|
14
|
+
appraisal (1.0.2)
|
15
|
+
bundler
|
16
|
+
rake
|
17
|
+
thor (>= 0.14.0)
|
18
|
+
builder (3.2.2)
|
19
|
+
codeclimate-test-reporter (0.4.1)
|
20
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
21
|
+
coveralls (0.7.1)
|
22
|
+
multi_json (~> 1.3)
|
23
|
+
rest-client
|
24
|
+
simplecov (>= 0.7)
|
25
|
+
term-ansicolor
|
26
|
+
thor
|
27
|
+
docile (1.1.5)
|
28
|
+
i18n (0.6.11)
|
29
|
+
mime-types (2.4.3)
|
30
|
+
minitest (5.4.3)
|
31
|
+
minitest-reporters (1.0.7)
|
32
|
+
ansi
|
33
|
+
builder
|
34
|
+
minitest (>= 5.0)
|
35
|
+
ruby-progressbar
|
36
|
+
multi_json (1.10.1)
|
37
|
+
netrc (0.8.0)
|
38
|
+
rake (10.3.2)
|
39
|
+
rest-client (1.7.2)
|
40
|
+
mime-types (>= 1.16, < 3.0)
|
41
|
+
netrc (~> 0.7)
|
42
|
+
ruby-progressbar (1.7.0)
|
43
|
+
shoulda (3.5.0)
|
44
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
45
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
46
|
+
shoulda-context (1.2.1)
|
47
|
+
shoulda-matchers (2.7.0)
|
48
|
+
activesupport (>= 3.0.0)
|
49
|
+
simplecov (0.9.1)
|
50
|
+
docile (~> 1.1.0)
|
51
|
+
multi_json (~> 1.0)
|
52
|
+
simplecov-html (~> 0.8.0)
|
53
|
+
simplecov-html (0.8.0)
|
54
|
+
term-ansicolor (1.3.0)
|
55
|
+
tins (~> 1.0)
|
56
|
+
thor (0.19.1)
|
57
|
+
tins (1.3.3)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
ruby
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
activesupport (~> 3.2.0)
|
64
|
+
appraisal
|
65
|
+
assert_difference!
|
66
|
+
bundler
|
67
|
+
codeclimate-test-reporter
|
68
|
+
coveralls
|
69
|
+
minitest
|
70
|
+
minitest-reporters
|
71
|
+
rake
|
72
|
+
shoulda
|
@@ -0,0 +1,80 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
assert_difference (0.5.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (4.0.9)
|
11
|
+
i18n (~> 0.6, >= 0.6.9)
|
12
|
+
minitest (~> 4.2)
|
13
|
+
multi_json (~> 1.3)
|
14
|
+
thread_safe (~> 0.1)
|
15
|
+
tzinfo (~> 0.3.37)
|
16
|
+
ansi (1.4.3)
|
17
|
+
appraisal (1.0.2)
|
18
|
+
bundler
|
19
|
+
rake
|
20
|
+
thor (>= 0.14.0)
|
21
|
+
builder (3.2.2)
|
22
|
+
codeclimate-test-reporter (0.4.1)
|
23
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
24
|
+
coveralls (0.7.1)
|
25
|
+
multi_json (~> 1.3)
|
26
|
+
rest-client
|
27
|
+
simplecov (>= 0.7)
|
28
|
+
term-ansicolor
|
29
|
+
thor
|
30
|
+
docile (1.1.5)
|
31
|
+
hashie (3.3.1)
|
32
|
+
i18n (0.6.11)
|
33
|
+
mime-types (2.4.3)
|
34
|
+
minitest (4.7.5)
|
35
|
+
minitest-reporters (0.14.24)
|
36
|
+
ansi
|
37
|
+
builder
|
38
|
+
minitest (>= 2.12, < 5.0)
|
39
|
+
powerbar
|
40
|
+
multi_json (1.10.1)
|
41
|
+
netrc (0.8.0)
|
42
|
+
powerbar (1.0.11)
|
43
|
+
ansi (~> 1.4.0)
|
44
|
+
hashie (>= 1.1.0)
|
45
|
+
rake (10.3.2)
|
46
|
+
rest-client (1.7.2)
|
47
|
+
mime-types (>= 1.16, < 3.0)
|
48
|
+
netrc (~> 0.7)
|
49
|
+
shoulda (3.5.0)
|
50
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
51
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
52
|
+
shoulda-context (1.2.1)
|
53
|
+
shoulda-matchers (2.7.0)
|
54
|
+
activesupport (>= 3.0.0)
|
55
|
+
simplecov (0.9.1)
|
56
|
+
docile (~> 1.1.0)
|
57
|
+
multi_json (~> 1.0)
|
58
|
+
simplecov-html (~> 0.8.0)
|
59
|
+
simplecov-html (0.8.0)
|
60
|
+
term-ansicolor (1.3.0)
|
61
|
+
tins (~> 1.0)
|
62
|
+
thor (0.19.1)
|
63
|
+
thread_safe (0.3.4)
|
64
|
+
tins (1.3.3)
|
65
|
+
tzinfo (0.3.41)
|
66
|
+
|
67
|
+
PLATFORMS
|
68
|
+
ruby
|
69
|
+
|
70
|
+
DEPENDENCIES
|
71
|
+
activesupport (~> 4.0.0)
|
72
|
+
appraisal
|
73
|
+
assert_difference!
|
74
|
+
bundler
|
75
|
+
codeclimate-test-reporter
|
76
|
+
coveralls
|
77
|
+
minitest
|
78
|
+
minitest-reporters
|
79
|
+
rake
|
80
|
+
shoulda
|
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
assert_difference (0.5.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (4.1.5)
|
11
|
+
i18n (~> 0.6, >= 0.6.9)
|
12
|
+
json (~> 1.7, >= 1.7.7)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
thread_safe (~> 0.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
ansi (1.4.3)
|
17
|
+
appraisal (1.0.2)
|
18
|
+
bundler
|
19
|
+
rake
|
20
|
+
thor (>= 0.14.0)
|
21
|
+
builder (3.2.2)
|
22
|
+
codeclimate-test-reporter (0.4.1)
|
23
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
24
|
+
coveralls (0.7.1)
|
25
|
+
multi_json (~> 1.3)
|
26
|
+
rest-client
|
27
|
+
simplecov (>= 0.7)
|
28
|
+
term-ansicolor
|
29
|
+
thor
|
30
|
+
docile (1.1.5)
|
31
|
+
i18n (0.6.11)
|
32
|
+
json (1.8.1)
|
33
|
+
mime-types (2.4.3)
|
34
|
+
minitest (5.4.3)
|
35
|
+
minitest-reporters (1.0.7)
|
36
|
+
ansi
|
37
|
+
builder
|
38
|
+
minitest (>= 5.0)
|
39
|
+
ruby-progressbar
|
40
|
+
multi_json (1.10.1)
|
41
|
+
netrc (0.8.0)
|
42
|
+
rake (10.3.2)
|
43
|
+
rest-client (1.7.2)
|
44
|
+
mime-types (>= 1.16, < 3.0)
|
45
|
+
netrc (~> 0.7)
|
46
|
+
ruby-progressbar (1.7.0)
|
47
|
+
shoulda (3.5.0)
|
48
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
49
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
50
|
+
shoulda-context (1.2.1)
|
51
|
+
shoulda-matchers (2.7.0)
|
52
|
+
activesupport (>= 3.0.0)
|
53
|
+
simplecov (0.9.1)
|
54
|
+
docile (~> 1.1.0)
|
55
|
+
multi_json (~> 1.0)
|
56
|
+
simplecov-html (~> 0.8.0)
|
57
|
+
simplecov-html (0.8.0)
|
58
|
+
term-ansicolor (1.3.0)
|
59
|
+
tins (~> 1.0)
|
60
|
+
thor (0.19.1)
|
61
|
+
thread_safe (0.3.4)
|
62
|
+
tins (1.3.3)
|
63
|
+
tzinfo (1.2.2)
|
64
|
+
thread_safe (~> 0.1)
|
65
|
+
|
66
|
+
PLATFORMS
|
67
|
+
ruby
|
68
|
+
|
69
|
+
DEPENDENCIES
|
70
|
+
activesupport (~> 4.1.0)
|
71
|
+
appraisal
|
72
|
+
assert_difference!
|
73
|
+
bundler
|
74
|
+
codeclimate-test-reporter
|
75
|
+
coveralls
|
76
|
+
minitest
|
77
|
+
minitest-reporters
|
78
|
+
rake
|
79
|
+
shoulda
|
data/lib/assert_difference.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2010, 2011, 2012 José Pablo Fernández
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Copyright © 2010, 2011, 2012, 2014 José Pablo Fernández
|
3
3
|
|
4
|
-
|
5
|
-
VERSION = "0.5.0" unless defined?(::AssertDifference::VERSION)
|
4
|
+
require "active_support/core_ext/array/wrap"
|
6
5
|
|
6
|
+
module AssertDifference
|
7
7
|
# Test numeric difference between the return value of an expression as a result of what is evaluated
|
8
8
|
# in the yielded block.
|
9
9
|
#
|
@@ -64,43 +64,61 @@ module AssertDifference
|
|
64
64
|
# post :something
|
65
65
|
# end
|
66
66
|
#
|
67
|
-
# @param [Array, Hash]
|
68
|
-
# table of
|
67
|
+
# @param [Array, Hash] expectations array of expectations to evaluate or hash
|
68
|
+
# table of expectations and expected difference.
|
69
69
|
# @param [Integer or Range] expected_difference expected difference when using an array or single expression.
|
70
|
-
# @param [String, nil] message error message to display
|
71
|
-
# @return whatever the block returned
|
72
|
-
def assert_difference(
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
70
|
+
# @param [String, nil] message error message to display on top of the description of the expectation failed.
|
71
|
+
# @return Object whatever the block returned
|
72
|
+
def assert_difference(expectations, expected_difference = 1, message = nil, &block)
|
73
|
+
binding = block.send(:binding)
|
74
|
+
expectations = expectations_as_hash(expected_difference, expectations) unless expectations.is_a? Hash
|
75
|
+
before = expectations.keys.each_with_object({}) { |expression, before| before[expression] = eval(expression, binding) }
|
76
|
+
|
77
|
+
result = yield
|
78
|
+
|
79
|
+
after = expectations.keys.each_with_object({}) { |expression, after| after[expression] = eval(expression, binding) }
|
80
|
+
error_messages = generate_error_messages(after, before, expectations, message)
|
81
|
+
if error_messages.any?
|
82
|
+
fail error_messages.join("\n\n").strip
|
78
83
|
end
|
79
84
|
|
80
|
-
|
81
|
-
|
85
|
+
return result
|
86
|
+
end
|
82
87
|
|
83
|
-
|
88
|
+
private
|
84
89
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
# Turn an array or a single expression into a hash of expectations and expectations.
|
91
|
+
def expectations_as_hash(expected_difference, expressions)
|
92
|
+
Array.wrap(expressions).each_with_object({}) { |expression, expressions| expressions[expression] = expected_difference }
|
93
|
+
end
|
94
|
+
|
95
|
+
# For the cases in which there isn't a match, generate an error message.
|
96
|
+
def generate_error_messages(after, before, expressions, message)
|
97
|
+
expressions.map do |expression, expected_difference|
|
98
|
+
expected_value = generate_expected_value(before[expression], expected_difference)
|
99
|
+
if !expression_passes?(after[expression], expected_value)
|
100
|
+
error = "#{expression.inspect} didn't change by #{expected_difference} (expecting #{expected_value}, but got #{after[expression]})"
|
95
101
|
error = "#{message}.\n#{error}" if message
|
96
|
-
|
102
|
+
error
|
97
103
|
end
|
98
|
-
end
|
104
|
+
end.compact
|
105
|
+
end
|
99
106
|
|
100
|
-
|
101
|
-
|
107
|
+
# Generate the expected value or range based of the value before and the expected difference.
|
108
|
+
def generate_expected_value(before, expected_difference)
|
109
|
+
if expected_difference.is_a? Range
|
110
|
+
(before + expected_difference.first)..(before + expected_difference.end)
|
111
|
+
else
|
112
|
+
before + expected_difference
|
102
113
|
end
|
114
|
+
end
|
103
115
|
|
104
|
-
|
116
|
+
# Do the appropriate comparison depending on whether the expectation is a range or a value
|
117
|
+
def expression_passes?(actual_difference, expected_value)
|
118
|
+
if expected_value.is_a?(Range)
|
119
|
+
expected_value.include?(actual_difference)
|
120
|
+
else
|
121
|
+
expected_value == actual_difference
|
122
|
+
end
|
105
123
|
end
|
106
124
|
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# Copyright © 2010, José Pablo Fernández
|
2
|
+
|
3
|
+
require_relative "test_helper"
|
4
|
+
|
5
|
+
require "assert_difference"
|
6
|
+
|
7
|
+
class AssertDifferenceTest < MiniTest::Unit::TestCase
|
8
|
+
include AssertDifference
|
9
|
+
|
10
|
+
should "pass when change is implicit" do
|
11
|
+
value = [1, 2, 3]
|
12
|
+
assert_difference "value.count" do
|
13
|
+
value << 4
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
should "pass when change is explicit" do
|
18
|
+
value = [1, 2, 3]
|
19
|
+
assert_difference "value.count" => +1 do
|
20
|
+
value << 4
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
should "pass when change is not 1" do
|
25
|
+
value1 = [1, 2, 3]
|
26
|
+
value2 = [1, 2, 3]
|
27
|
+
value3 = [1, 3, 3]
|
28
|
+
assert_difference "value1.count" => +2,
|
29
|
+
"value2.count" => -2,
|
30
|
+
"value3.count" => 0 do
|
31
|
+
value1 << 4
|
32
|
+
value1 << 5
|
33
|
+
value2.delete(3)
|
34
|
+
value2.delete(2)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
should "pass when change is a range" do
|
39
|
+
value = [1, 2, 3]
|
40
|
+
assert_difference "value.count" => -1..3 do
|
41
|
+
value << 4
|
42
|
+
end
|
43
|
+
assert_difference "value.count" => -1..3 do
|
44
|
+
value << 5
|
45
|
+
value << 6
|
46
|
+
end
|
47
|
+
assert_difference "value.count" => -1..3 do
|
48
|
+
value.delete(1)
|
49
|
+
end
|
50
|
+
assert_difference "value.count" => -1..3 do
|
51
|
+
# no change
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
should "fail when change doesn't happen" do
|
56
|
+
value = [1, 2, 3]
|
57
|
+
assert_raises RuntimeError do
|
58
|
+
assert_difference "value.count" do
|
59
|
+
# No change
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
should "fail when it changes too much" do
|
65
|
+
value = [1, 2, 3]
|
66
|
+
assert_raises RuntimeError do
|
67
|
+
assert_difference "value.count" do
|
68
|
+
value << 4
|
69
|
+
value << 5
|
70
|
+
end
|
71
|
+
end
|
72
|
+
assert_raises RuntimeError do
|
73
|
+
assert_difference "value.count" => 1..3 do
|
74
|
+
value << 6
|
75
|
+
value << 7
|
76
|
+
value << 8
|
77
|
+
value << 9
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Copyright © 2010, 2014, José Pablo Fernández
|
3
|
+
|
4
|
+
require "rubygems"
|
5
|
+
|
6
|
+
# Test coverage
|
7
|
+
require "simplecov"
|
8
|
+
require "coveralls"
|
9
|
+
SimpleCov.start do
|
10
|
+
add_filter "/test/"
|
11
|
+
end
|
12
|
+
if ENV["CI"]
|
13
|
+
Coveralls.wear!
|
14
|
+
require "codeclimate-test-reporter"
|
15
|
+
CodeClimate::TestReporter.start
|
16
|
+
end
|
17
|
+
|
18
|
+
require "minitest/autorun"
|
19
|
+
require "minitest/reporters"
|
20
|
+
MiniTest::Reporters.use!
|
21
|
+
require "shoulda"
|
22
|
+
require "shoulda-context"
|
23
|
+
|
24
|
+
# Make the code to be tested easy to load.
|
25
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
26
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
metadata
CHANGED
@@ -1,30 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert_difference
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- J. Pablo Fernández
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
14
|
+
name: activesupport
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: appraisal
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codeclimate-test-reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
20
74
|
- !ruby/object:Gem::Version
|
21
75
|
version: '0'
|
22
76
|
type: :development
|
23
77
|
prerelease: false
|
24
78
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
79
|
requirements:
|
27
|
-
- -
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest-reporters
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: shoulda
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
28
137
|
- !ruby/object:Gem::Version
|
29
138
|
version: '0'
|
30
139
|
description: Like Rails' assert_difference, but more compact and readable syntax through
|
@@ -35,38 +144,53 @@ executables: []
|
|
35
144
|
extensions: []
|
36
145
|
extra_rdoc_files: []
|
37
146
|
files:
|
38
|
-
- .gitignore
|
147
|
+
- ".gitignore"
|
148
|
+
- ".travis.yml"
|
149
|
+
- Appraisals
|
150
|
+
- CHANGELOG.md
|
39
151
|
- Gemfile
|
40
152
|
- LICENSE
|
41
153
|
- README.md
|
42
154
|
- Rakefile
|
43
155
|
- assert_difference.gemspec
|
156
|
+
- gemfiles/activesupport_3_0.gemfile
|
157
|
+
- gemfiles/activesupport_3_0.gemfile.lock
|
158
|
+
- gemfiles/activesupport_3_1.gemfile
|
159
|
+
- gemfiles/activesupport_3_1.gemfile.lock
|
160
|
+
- gemfiles/activesupport_3_2.gemfile
|
161
|
+
- gemfiles/activesupport_3_2.gemfile.lock
|
162
|
+
- gemfiles/activesupport_4_0.gemfile
|
163
|
+
- gemfiles/activesupport_4_0.gemfile.lock
|
164
|
+
- gemfiles/activesupport_4_1.gemfile
|
165
|
+
- gemfiles/activesupport_4_1.gemfile.lock
|
44
166
|
- lib/assert_difference.rb
|
45
|
-
-
|
46
|
-
- test/
|
47
|
-
|
48
|
-
|
167
|
+
- lib/assert_difference/version.rb
|
168
|
+
- test/assert_difference_test.rb
|
169
|
+
- test/test_helper.rb
|
170
|
+
homepage: https://github.com/pupeno/assert_difference
|
171
|
+
licenses:
|
172
|
+
- MIT
|
173
|
+
metadata: {}
|
49
174
|
post_install_message:
|
50
175
|
rdoc_options: []
|
51
176
|
require_paths:
|
52
177
|
- lib
|
53
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
179
|
requirements:
|
56
|
-
- -
|
180
|
+
- - ">="
|
57
181
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
182
|
+
version: 1.9.3
|
59
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
184
|
requirements:
|
62
|
-
- -
|
185
|
+
- - ">="
|
63
186
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
187
|
+
version: '0'
|
65
188
|
requirements: []
|
66
|
-
rubyforge_project:
|
67
|
-
rubygems_version:
|
189
|
+
rubyforge_project:
|
190
|
+
rubygems_version: 2.4.3
|
68
191
|
signing_key:
|
69
|
-
specification_version:
|
192
|
+
specification_version: 4
|
70
193
|
summary: Like Rails' assert_difference, but more powerful
|
71
|
-
test_files:
|
72
|
-
|
194
|
+
test_files:
|
195
|
+
- test/assert_difference_test.rb
|
196
|
+
- test/test_helper.rb
|
data/test/helper.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Copyright © 2010, José Pablo Fernández
|
2
|
-
|
3
|
-
require "rubygems"
|
4
|
-
require "test/unit"
|
5
|
-
|
6
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
8
|
-
require "assert_difference"
|
9
|
-
|
10
|
-
class Test::Unit::TestCase
|
11
|
-
end
|