kitestrings 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/kitestrings/install_generator.rb +1 -9
- data/lib/generators/templates/spec/{rails_helper.rb.tt → rails_helper.rb} +15 -25
- data/lib/generators/templates/support/database_cleaner.rb +21 -0
- data/lib/generators/templates/support/fracture.rb +5 -0
- data/lib/kitestrings/version.rb +1 -1
- data/spec/lib/array_validator_spec.rb +1 -1
- data/spec/lib/async_spec.rb +1 -1
- data/spec/lib/generators/kitestrings/install_generator_spec.rb +1 -4
- data/spec/lib/generators/kitestrings/messages_generator_spec.rb +1 -1
- data/spec/lib/kitestrings/menu/model_spec.rb +1 -1
- data/spec/lib/page_and_sort_helper_spec.rb +1 -1
- data/spec/lib/size_validator_spec.rb +1 -1
- metadata +4 -4
- data/lib/generators/templates/spec_ext/my_ip_spec.rb +0 -7
- data/lib/generators/templates/spec_ext/spec_helper_ext.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df7ed23de080fadb279e04672d4317c86160169f
|
4
|
+
data.tar.gz: 7aa6417285a8bd8c7cc8a53d2fcc8fed4df92386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35aa28fcde35344c176d9508a513a41cd00017b34e3d188b3779e25c505a4a581f24eb8c1c54e53accc5800530af321fe31e1279390f9a5a403dbffa721f7d37
|
7
|
+
data.tar.gz: 0dff13d849b4a8fe8639d76389f9ef082d827f8ea9aba9912a22ca8e26f57d8043d5cfdb2177a3404bce9af53c627a91ed88f739d9958ca8d16a3f339ebf5664
|
@@ -27,17 +27,13 @@ module Kitestrings
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def copy_spec_files
|
30
|
-
|
30
|
+
copy_file "spec/rails_helper.rb", "spec/rails_helper.rb"
|
31
31
|
end
|
32
32
|
|
33
33
|
def copy_spec_support_files
|
34
34
|
directory "support", "spec/support"
|
35
35
|
end
|
36
36
|
|
37
|
-
def copy_spec_ext
|
38
|
-
directory "spec_ext", "spec_ext"
|
39
|
-
end
|
40
|
-
|
41
37
|
def copy_app_view_files
|
42
38
|
copy_file "views/application/_navigation.html.haml", "app/views/application/_navigation.html.haml"
|
43
39
|
copy_file "views/layouts/application.html.haml", "app/views/layouts/application.html.haml"
|
@@ -60,10 +56,6 @@ module Kitestrings
|
|
60
56
|
end
|
61
57
|
end
|
62
58
|
|
63
|
-
def setup_directories
|
64
|
-
empty_directory("lib/capistrano")
|
65
|
-
create_file("lib/capistrano/.keep")
|
66
|
-
end
|
67
59
|
end
|
68
60
|
end
|
69
61
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
2
|
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
3
4
|
require File.expand_path("../../config/environment", __FILE__)
|
4
5
|
require 'rspec/rails'
|
5
6
|
require 'rspec/autorun'
|
@@ -8,12 +9,10 @@ require 'rspec/autorun'
|
|
8
9
|
# in spec/support/ and its subdirectories.
|
9
10
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
10
11
|
|
11
|
-
<% if ::Rails::VERSION::STRING >= '4' -%>
|
12
12
|
# Checks for pending migrations before tests are run.
|
13
13
|
# If you are not using ActiveRecord, you can remove this line.
|
14
14
|
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
15
15
|
|
16
|
-
<% end -%>
|
17
16
|
RSpec.configure do |config|
|
18
17
|
# clear the test log file before we start.
|
19
18
|
log_file = Rails.root.join("log/test.log")
|
@@ -50,28 +49,19 @@ RSpec.configure do |config|
|
|
50
49
|
# --seed 1234
|
51
50
|
config.order = "random"
|
52
51
|
|
53
|
-
config.before(:suite) do
|
54
|
-
DatabaseCleaner.clean_with(:truncation)
|
55
|
-
end
|
56
52
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
config.
|
71
|
-
DatabaseCleaner.clean
|
72
|
-
end
|
73
|
-
|
74
|
-
config.after(:all) do
|
75
|
-
Fracture.clear
|
76
|
-
end
|
53
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
54
|
+
# based on their file location, for example enabling you to call `get` and
|
55
|
+
# `post` in specs under `spec/controllers`.
|
56
|
+
#
|
57
|
+
# You can disable this behaviour by removing the line below, and instead
|
58
|
+
# explicitly tag your specs with their type, e.g.:
|
59
|
+
#
|
60
|
+
# RSpec.describe UsersController, :type => :controller do
|
61
|
+
# # ...
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
# The different available types are documented in the features, such as in
|
65
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
66
|
+
config.infer_spec_type_from_file_location!
|
77
67
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
config.before(:suite) do
|
3
|
+
DatabaseCleaner.clean_with(:truncation)
|
4
|
+
end
|
5
|
+
|
6
|
+
config.before(:each) do
|
7
|
+
DatabaseCleaner.strategy = :transaction
|
8
|
+
end
|
9
|
+
|
10
|
+
config.before(:each, :js => true) do
|
11
|
+
DatabaseCleaner.strategy = :truncation
|
12
|
+
end
|
13
|
+
|
14
|
+
config.before(:each) do
|
15
|
+
DatabaseCleaner.start
|
16
|
+
end
|
17
|
+
|
18
|
+
config.after(:each) do
|
19
|
+
DatabaseCleaner.clean
|
20
|
+
end
|
21
|
+
end
|
data/lib/kitestrings/version.rb
CHANGED
data/spec/lib/async_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'spec_helper'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'generator_spec'
|
4
4
|
require 'generators/kitestrings/install_generator'
|
@@ -17,8 +17,6 @@ describe Kitestrings::Generators::InstallGenerator do
|
|
17
17
|
|
18
18
|
context "check files" do
|
19
19
|
%w[
|
20
|
-
spec_ext/my_ip_spec.rb
|
21
|
-
spec_ext/rails_helper_ext.rb
|
22
20
|
spec/rails_helper.rb
|
23
21
|
config/deploy.rb
|
24
22
|
config/deploy/integ.rb
|
@@ -40,7 +38,6 @@ describe Kitestrings::Generators::InstallGenerator do
|
|
40
38
|
app/views/public/403.html
|
41
39
|
app/views/layouts/application.html.haml
|
42
40
|
app/views/application/_navigation.html.haml
|
43
|
-
lib/capistrano/.keep
|
44
41
|
].each do |file|
|
45
42
|
it "created #{file}" do
|
46
43
|
path = file_path(file)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitestrings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ridget
|
@@ -143,9 +143,9 @@ files:
|
|
143
143
|
- lib/generators/templates/rspec/model/model_spec.rb
|
144
144
|
- lib/generators/templates/rspec/scaffold/controller_spec.rb
|
145
145
|
- lib/generators/templates/rspec/scaffold/routing_spec.rb
|
146
|
-
- lib/generators/templates/spec/rails_helper.rb
|
147
|
-
- lib/generators/templates/
|
148
|
-
- lib/generators/templates/
|
146
|
+
- lib/generators/templates/spec/rails_helper.rb
|
147
|
+
- lib/generators/templates/support/database_cleaner.rb
|
148
|
+
- lib/generators/templates/support/fracture.rb
|
149
149
|
- lib/generators/templates/support/render_views.rb
|
150
150
|
- lib/generators/templates/views/application/_navigation.html.haml
|
151
151
|
- lib/generators/templates/views/layouts/application.html.haml
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
|
3
|
-
ENV["RAILS_ENV"] ||= 'test'
|
4
|
-
require File.expand_path("../../config/environment", __FILE__)
|
5
|
-
require 'rspec/rails'
|
6
|
-
|
7
|
-
# ensure that we have a network connection to the internet before running any of these tests.
|
8
|
-
begin
|
9
|
-
require 'net/http'
|
10
|
-
Net::HTTP.get("google.com", '/')
|
11
|
-
rescue Interrupt
|
12
|
-
exit 0
|
13
|
-
rescue StandardError
|
14
|
-
puts "Network offline!"
|
15
|
-
exit 1
|
16
|
-
end
|
17
|
-
|
18
|
-
# load support files:
|
19
|
-
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
20
|
-
|
21
|
-
RSpec.configure do |config|
|
22
|
-
# Run specs in random order to surface order dependencies. If you find an
|
23
|
-
# order dependency and want to debug it, you can fix the order by providing
|
24
|
-
# the seed, which is printed after each run.
|
25
|
-
# --seed 1234
|
26
|
-
config.order = "random"
|
27
|
-
|
28
|
-
config.use_transactional_fixtures = false
|
29
|
-
|
30
|
-
# include any other modules
|
31
|
-
|
32
|
-
# add global before/after blocks:
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
# turn of deprecation warning.
|
37
|
-
I18n.enforce_available_locales = false
|