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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -16
  3. data/lib/evil_systems/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40a098c8d111a96295203242dca8c4b3c8c74d9562617964354b190894f8db09
4
- data.tar.gz: 8ee1193bc9c323dc8bf82c2668fdad6f182dee7a81a31277ad57d0bb990d8ac4
3
+ metadata.gz: e260134685b60dd32d198ed9e16d06c951c8efca2a5e7f7839c6f2bd25a513cd
4
+ data.tar.gz: e46a0563606043cadad08f2ccc9e301f3407120bf5b3c4b15275cba5096e2a78
5
5
  SHA512:
6
- metadata.gz: 6c159f5a4de7c8d8434e47875fe6d7f639541db4e08f14a934d80af96c533aff29eb3eefd9287fe0114d97b7c3f487cf3b6a090fed4f0c74882f3d93c4f2bb3f
7
- data.tar.gz: d5abc78bdbdebf015ec62bcdc0c737f2ffc91002971664cc6424736f065b37db9e48552e0c168f8f4f913294c50ac98d782dcfa07a4e8f7d364d68669e909d29
6
+ metadata.gz: a94ba44801ac0e86b5c519795b8de8dc8b2f55029df0e11d8228b059675f473d97dc8efec3c022b53b9763a0b5c4fbf9f21fe135a614bcfb7b0769d714434a33
7
+ data.tar.gz: 81356df72c18b1669bc45b48ff61f118d32a90e48a3a6bd269daedf4c804441116fea2e67cf625982a1e5beb527ce14fd8867cb3422159422a7470ccba1c5f7b
data/README.md CHANGED
@@ -1,10 +1,23 @@
1
- # EvilSystemTests
1
+ # Purpose
2
2
 
3
- Why does this exist?
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
- I wanted a quick, easy, reusable way to use the settings put forth in
6
- [EvilMartians System of a Test blog post](https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing)
7
- for Minitest. System of a test is currently written for RSpec.
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
- Add this line to your application's Gemfile:
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
- gem 'evil_system_tests'
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
- ```diff
58
+ ```ruby
36
59
  # test/application_system_test_case.rb
37
60
 
38
61
  require 'test_helper'
39
62
 
40
- + # 'capybara' and 'capybara/cuprite' need to be defined for EvilSystems to work properly.
41
- + require 'capybara'
42
- + require 'capybara/cuprite'
63
+ # 'capybara' and 'capybara/cuprite' need to be defined for EvilSystems to work properly.
64
+ require 'capybara'
65
+ require 'capybara/cuprite'
43
66
 
44
- + require 'evil_systems'
67
+ require 'evil_systems'
45
68
 
46
- + EvilSystems.initial_setup
69
+ EvilSystems.initial_setup
47
70
 
48
71
  class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
49
- - driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
50
- + driven_by :cuprite
72
+ driven_by :cuprite
51
73
 
52
- + include EvilSystems::Helpers
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`
@@ -1,3 +1,3 @@
1
1
  module EvilSystems
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evil_systems
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ParamagicDev