minitest-utils 0.2.1 → 0.2.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 468b60a2bf50be679f0fc0e314de6f397a5ce092
|
4
|
+
data.tar.gz: a409611a3281fa5716e37f2eb2f1c4a52d6b2424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27d0fd6c547c43a2573c31c3a7104af730e5528e7723d54ea9c657d910e750a0472412972c5db3d878cfe11eae8378ee170c828687fc24f610db72bbedfa77c0
|
7
|
+
data.tar.gz: 56c7310b1d63bdd965ceaa876d46c2e43a0a462926fb3b810161841e883fdcde99abd723f8b0995952b8bdba0a7b8cc53fbe3086089f65a86c8d69115f3c819e
|
data/README.md
CHANGED
@@ -64,6 +64,28 @@ end
|
|
64
64
|

|
65
65
|

|
66
66
|
|
67
|
+
## Rails extensions
|
68
|
+
|
69
|
+
minitest-utils sets up some things for your Rails application. Just load `minitest/utils/rails` to set up:
|
70
|
+
|
71
|
+
- [Capybara](https://github.com/jnicklas/capybara): includes `Capybara::DSL`, sets default driver before every test, resets session and creates a helper method for setting JavaScript driver.
|
72
|
+
- [FactoryGirl](https://github.com/thoughtbot/factory_girl): adds methods to `ActiveSupport::TestCase`.
|
73
|
+
- [WebMock](https://github.com/bblimke/webmock): disables external requests (except for codeclimate) and tracks all requests on `WebMock.requests`.
|
74
|
+
- locale routes: sets `Rails.application.routes.default_url_options[:locale]` with your current locale.
|
75
|
+
- [DatabaseCleaner](https://github.com/DatabaseCleaner/database_cleaner): runs `DatabaseCleaner.start` and `DatabaseCleaner.clean` before and after every test respectively.
|
76
|
+
- Other: `t` and `l` alias to I18n.
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
class SignupTest < ActionDispatch::IntegrationTtest
|
80
|
+
use_javascript! #=> enables JavaScript driver
|
81
|
+
end
|
82
|
+
```
|
83
|
+
|
84
|
+
Also, if you're using routes like `:locale` scope, you can load this file to automatically set your route's `:locale` param.
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
require 'minitest/utils/rails/locale'
|
88
|
+
```
|
67
89
|
|
68
90
|
## Development
|
69
91
|
|
@@ -73,7 +95,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
73
95
|
|
74
96
|
## Contributing
|
75
97
|
|
76
|
-
1. Fork it ( https://github.com/
|
98
|
+
1. Fork it ( https://github.com/fnando/minitest-utils/fork )
|
77
99
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
78
100
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
79
101
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/minitest/utils/rails.rb
CHANGED
@@ -4,6 +4,7 @@ class ActiveSupport::TestCase
|
|
4
4
|
require 'minitest/utils/rails/webmock' if defined?(WebMock)
|
5
5
|
require 'minitest/utils/rails/capybara' if defined?(Capybara)
|
6
6
|
require 'minitest/utils/rails/factory_girl' if defined?(FactoryGirl)
|
7
|
+
require 'minitest/utils/rails/database_cleaner' if defined?(DatabaseCleaner)
|
7
8
|
|
8
9
|
def t(*args)
|
9
10
|
I18n.t(*args)
|
@@ -20,13 +20,17 @@ module Minitest
|
|
20
20
|
@color_enabled = io.respond_to?(:tty?) && io.tty?
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
23
|
+
def record(result)
|
24
24
|
super
|
25
|
+
print_result_code(result.result_code)
|
25
26
|
end
|
26
27
|
|
27
|
-
def
|
28
|
+
def start
|
28
29
|
super
|
29
|
-
|
30
|
+
io.puts "Run options: #{options[:args]}"
|
31
|
+
io.puts
|
32
|
+
io.puts "# Running:"
|
33
|
+
io.puts
|
30
34
|
end
|
31
35
|
|
32
36
|
def report
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -84,7 +84,9 @@ files:
|
|
84
84
|
- lib/minitest/utils/extension.rb
|
85
85
|
- lib/minitest/utils/rails.rb
|
86
86
|
- lib/minitest/utils/rails/capybara.rb
|
87
|
+
- lib/minitest/utils/rails/database_cleaner.rb
|
87
88
|
- lib/minitest/utils/rails/factory_girl.rb
|
89
|
+
- lib/minitest/utils/rails/locale.rb
|
88
90
|
- lib/minitest/utils/rails/webmock.rb
|
89
91
|
- lib/minitest/utils/reporter.rb
|
90
92
|
- lib/minitest/utils/test_notifier_reporter.rb
|
@@ -114,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
116
|
version: '0'
|
115
117
|
requirements: []
|
116
118
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.4.
|
119
|
+
rubygems_version: 2.4.5.1
|
118
120
|
signing_key:
|
119
121
|
specification_version: 4
|
120
122
|
summary: Some utilities for your Minitest day-to-day usage.
|