minitest-utils 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +6 -5
- data/lib/minitest/utils/rails/locale.rb +32 -12
- data/lib/minitest/utils/setup/database_cleaner.rb +2 -4
- data/lib/minitest/utils/version.rb +1 -1
- data/lib/minitest/utils_plugin.rb +2 -1
- data/minitest-utils.gemspec +12 -12
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ddba2298a0f74ee9dcc78a844c600284a53733
|
4
|
+
data.tar.gz: 99b5b13394035577ba2eab4ae2515cf951d41487
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 340f18f999a7bde3f38a69bad3d1419f090b5b7a57aff5d71fe22c951af37e4465e1960fdbe83b1ba5a010eece8a058422e297ade0356336cc7de31fdfb850d0
|
7
|
+
data.tar.gz: 0313d960f7af49be353ce3f88f321c9cc8a286bc847739079e0eb5a43d5271305c3b77a9b9a93c853b87d61f78c2aa1d1840d8130586ed8cf62e15b50fe9319e
|
data/README.md
CHANGED
@@ -84,7 +84,7 @@ minitest-utils sets up some things for your Rails application.
|
|
84
84
|
- [FactoryGirl](https://github.com/thoughtbot/factory_girl): adds methods to `ActiveSupport::TestCase`.
|
85
85
|
- [WebMock](https://github.com/bblimke/webmock): disables external requests (except for codeclimate) and tracks all requests on `WebMock.requests`.
|
86
86
|
- locale routes: sets `Rails.application.routes.default_url_options[:locale]` with your current locale.
|
87
|
-
- [DatabaseCleaner](https://github.com/DatabaseCleaner/database_cleaner):
|
87
|
+
- [DatabaseCleaner](https://github.com/DatabaseCleaner/database_cleaner): configure database before running each test. You can configure the strategy by settings `DatabaseCleaner.strategy = :truncation`, for instance. It defaults to `:deletion`.
|
88
88
|
- Other: `t` and `l` alias to I18n.
|
89
89
|
|
90
90
|
```ruby
|
data/Rakefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs <<
|
6
|
-
t.test_files = FileList[
|
7
|
-
t.verbose =
|
5
|
+
t.libs << "test"
|
6
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
7
|
+
t.verbose = false
|
8
|
+
t.warning = false
|
8
9
|
end
|
9
10
|
|
10
11
|
task :default => :test
|
@@ -1,29 +1,49 @@
|
|
1
|
+
module Minitest
|
2
|
+
module Utils
|
3
|
+
module Locale
|
4
|
+
class << self
|
5
|
+
attr_accessor :setup
|
6
|
+
attr_accessor :teardown
|
7
|
+
end
|
8
|
+
|
9
|
+
self.setup = proc do
|
10
|
+
Rails.application.routes.default_url_options[:locale] = I18n.locale
|
11
|
+
end
|
12
|
+
|
13
|
+
self.teardown = proc do
|
14
|
+
Rails.application.routes.default_url_options.delete(:locale)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.included(base)
|
18
|
+
base.setup do
|
19
|
+
instance_eval(&Minitest::Utils::Locale.setup)
|
20
|
+
end
|
21
|
+
|
22
|
+
base.teardown do
|
23
|
+
instance_eval(&Minitest::Utils::Locale.teardown)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
1
30
|
module ActionDispatch
|
2
31
|
class IntegrationTest
|
3
32
|
include Minitest::Utils::UrlHelpers
|
4
|
-
|
5
|
-
setup do
|
6
|
-
Rails.application.routes.default_url_options[:locale] = I18n.locale
|
7
|
-
end
|
33
|
+
include Minitest::Utils::Locale
|
8
34
|
end
|
9
35
|
end
|
10
36
|
|
11
37
|
module ActionController
|
12
38
|
class TestCase
|
13
39
|
include Minitest::Utils::UrlHelpers
|
14
|
-
|
15
|
-
setup do
|
16
|
-
Rails.application.routes.default_url_options[:locale] = I18n.locale
|
17
|
-
end
|
40
|
+
include Minitest::Utils::Locale
|
18
41
|
end
|
19
42
|
end
|
20
43
|
|
21
44
|
module ActionMailer
|
22
45
|
class TestCase
|
23
46
|
include Minitest::Utils::UrlHelpers
|
24
|
-
|
25
|
-
setup do
|
26
|
-
Rails.application.routes.default_url_options[:locale] = I18n.locale
|
27
|
-
end
|
47
|
+
include Minitest::Utils::Locale
|
28
48
|
end
|
29
49
|
end
|
data/minitest-utils.gemspec
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
require
|
1
|
+
require "./lib/minitest/utils/version"
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
|
-
spec.name =
|
4
|
+
spec.name = "minitest-utils"
|
5
5
|
spec.version = Minitest::Utils::VERSION
|
6
|
-
spec.authors = [
|
7
|
-
spec.email = [
|
8
|
-
spec.summary =
|
6
|
+
spec.authors = ["Nando Vieira"]
|
7
|
+
spec.email = ["fnando.vieira@gmail.com"]
|
8
|
+
spec.summary = "Some utilities for your Minitest day-to-day usage."
|
9
9
|
spec.description = spec.summary
|
10
|
-
spec.homepage =
|
10
|
+
spec.homepage = "http://github.com/fnando/minitest-utils"
|
11
11
|
|
12
12
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
13
|
-
spec.bindir =
|
13
|
+
spec.bindir = "exe"
|
14
14
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
15
|
-
spec.require_paths = [
|
15
|
+
spec.require_paths = ["lib"]
|
16
16
|
|
17
|
-
spec.add_dependency
|
18
|
-
spec.add_development_dependency
|
19
|
-
spec.add_development_dependency
|
20
|
-
spec.add_development_dependency
|
17
|
+
spec.add_dependency "minitest"
|
18
|
+
spec.add_development_dependency "bundler"
|
19
|
+
spec.add_development_dependency "rake"
|
20
|
+
spec.add_development_dependency "pry-meta"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: bundler
|
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: rake
|
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: pry-meta
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|