evil_systems 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +44 -16
- data/lib/evil_systems/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e260134685b60dd32d198ed9e16d06c951c8efca2a5e7f7839c6f2bd25a513cd
|
4
|
+
data.tar.gz: e46a0563606043cadad08f2ccc9e301f3407120bf5b3c4b15275cba5096e2a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a94ba44801ac0e86b5c519795b8de8dc8b2f55029df0e11d8228b059675f473d97dc8efec3c022b53b9763a0b5c4fbf9f21fe135a614bcfb7b0769d714434a33
|
7
|
+
data.tar.gz: 81356df72c18b1669bc45b48ff61f118d32a90e48a3a6bd269daedf4c804441116fea2e67cf625982a1e5beb527ce14fd8867cb3422159422a7470ccba1c5f7b
|
data/README.md
CHANGED
@@ -1,10 +1,23 @@
|
|
1
|
-
#
|
1
|
+
# Purpose
|
2
2
|
|
3
|
-
|
3
|
+
I write tests using Minitest and routinely reference [EvilMartians System
|
4
|
+
of a Test blog post](https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing)
|
5
|
+
for Minitest.) on best practices for system tests. In this blog post,
|
6
|
+
they also have an opinionated way of setting up System Tests.
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
+
`EvilSystems` offers 3 distinct advantages over the setup provided by
|
9
|
+
EvilMartians System of a Test:
|
10
|
+
|
11
|
+
1.) The blog post was built with RSpec in mind, but we use Minitest
|
12
|
+
here!
|
13
|
+
|
14
|
+
2.) Constantly copying 5 files over into every new Rails app is annoying. Lets make that easier!
|
15
|
+
|
16
|
+
3.) File changes can end up out of sync, a gem makes sure updates can be
|
17
|
+
pushed to all users.
|
18
|
+
|
19
|
+
`EvilSystems` is a quick, easy, reusable way to apply the SoaT concepts and settings
|
20
|
+
to projects for system tests using Minitest.
|
8
21
|
|
9
22
|
Full API documentation can be found here:
|
10
23
|
|
@@ -12,10 +25,20 @@ https://rdoc.info/github/paramagicdev/evil_systems/main
|
|
12
25
|
|
13
26
|
## Installation
|
14
27
|
|
15
|
-
|
28
|
+
```ruby
|
29
|
+
# Gemfile
|
30
|
+
group :test do
|
31
|
+
gem 'evil_system_tests'
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
Make sure the following 3 gems are in your `Gemfile` as well:
|
16
36
|
|
17
37
|
```ruby
|
18
|
-
|
38
|
+
# Gemfile
|
39
|
+
gem 'capybara'
|
40
|
+
gem 'selenium-webdriver' # Still required when using Cuprite as of Rails 6.1
|
41
|
+
gem 'cuprite' # Optional
|
19
42
|
```
|
20
43
|
|
21
44
|
And then execute:
|
@@ -32,24 +55,23 @@ Navigate to `test/application_system_test_case.rb` in your Rails app.
|
|
32
55
|
|
33
56
|
Setup your file like so:
|
34
57
|
|
35
|
-
```
|
58
|
+
```ruby
|
36
59
|
# test/application_system_test_case.rb
|
37
60
|
|
38
61
|
require 'test_helper'
|
39
62
|
|
40
|
-
|
41
|
-
|
42
|
-
|
63
|
+
# 'capybara' and 'capybara/cuprite' need to be defined for EvilSystems to work properly.
|
64
|
+
require 'capybara'
|
65
|
+
require 'capybara/cuprite'
|
43
66
|
|
44
|
-
|
67
|
+
require 'evil_systems'
|
45
68
|
|
46
|
-
|
69
|
+
EvilSystems.initial_setup
|
47
70
|
|
48
71
|
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
49
|
-
|
50
|
-
+ driven_by :cuprite
|
72
|
+
driven_by :cuprite
|
51
73
|
|
52
|
-
|
74
|
+
include EvilSystems::Helpers
|
53
75
|
end
|
54
76
|
```
|
55
77
|
|
@@ -72,6 +94,12 @@ are compiling, and how long the compilation took.
|
|
72
94
|
`:task` defaults to `assets:precompile`, System of a test uses
|
73
95
|
`webpacker:compile`.
|
74
96
|
|
97
|
+
Example:
|
98
|
+
|
99
|
+
```rb
|
100
|
+
EvilSystems.initial_setup(task: "webpacker:compile", silent: false)
|
101
|
+
```
|
102
|
+
|
75
103
|
### Settings
|
76
104
|
|
77
105
|
- [x] - Automatically registers a `:cuprite` driver if `Capybara::Cuprite`
|
data/lib/evil_systems/version.rb
CHANGED