react_on_rails 1.2.2 → 2.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. metadata +5 -126
  3. data/.babelrc +0 -3
  4. data/.coveralls.yml +0 -1
  5. data/.dockerignore +0 -2
  6. data/.eslintignore +0 -5
  7. data/.eslintrc +0 -48
  8. data/.gitignore +0 -26
  9. data/.jscsrc +0 -26
  10. data/.rspec +0 -2
  11. data/.rubocop.yml +0 -70
  12. data/.scss-lint.yml +0 -205
  13. data/.travis.yml +0 -41
  14. data/CHANGELOG.md +0 -42
  15. data/Dockerfile_tests +0 -12
  16. data/Gemfile +0 -38
  17. data/README.md +0 -363
  18. data/Rakefile +0 -5
  19. data/app/assets/javascripts/react_on_rails.js +0 -241
  20. data/app/helpers/react_on_rails_helper.rb +0 -224
  21. data/docker-compose.yml +0 -11
  22. data/docs/LICENSE +0 -21
  23. data/docs/additional_reading/heroku_deployment.md +0 -23
  24. data/docs/additional_reading/manual_installation.md +0 -142
  25. data/docs/additional_reading/node_dependencies_and_npm.md +0 -29
  26. data/docs/additional_reading/optional_configuration.md +0 -34
  27. data/docs/additional_reading/react-and-redux.md +0 -36
  28. data/docs/additional_reading/react_router.md +0 -45
  29. data/docs/additional_reading/server_rendering_tips.md +0 -16
  30. data/docs/additional_reading/tips.md +0 -10
  31. data/docs/additional_reading/webpack.md +0 -46
  32. data/docs/code_of_conduct.md +0 -13
  33. data/docs/coding-style/linters.md +0 -64
  34. data/docs/coding-style/style.md +0 -42
  35. data/docs/contributing.md +0 -62
  36. data/docs/generator_testing.md +0 -20
  37. data/docs/install_and_releasing.md +0 -24
  38. data/docs/sample_generated_js/README.md +0 -4
  39. data/docs/sample_generated_js/client-generated.js +0 -12
  40. data/docs/sample_generated_js/server-generated.js +0 -25
  41. data/lib/generators/USAGE +0 -99
  42. data/lib/generators/react_on_rails/base_generator.rb +0 -198
  43. data/lib/generators/react_on_rails/bootstrap_generator.rb +0 -91
  44. data/lib/generators/react_on_rails/dev_tests_generator.rb +0 -30
  45. data/lib/generators/react_on_rails/generator_errors.rb +0 -15
  46. data/lib/generators/react_on_rails/generator_helper.rb +0 -58
  47. data/lib/generators/react_on_rails/heroku_deployment_generator.rb +0 -30
  48. data/lib/generators/react_on_rails/install_generator.rb +0 -111
  49. data/lib/generators/react_on_rails/js_linters_generator.rb +0 -19
  50. data/lib/generators/react_on_rails/react_no_redux_generator.rb +0 -41
  51. data/lib/generators/react_on_rails/react_with_redux_generator.rb +0 -52
  52. data/lib/generators/react_on_rails/ruby_linters_generator.rb +0 -33
  53. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt +0 -4
  54. data/lib/generators/react_on_rails/templates/base/base/REACT_ON_RAILS.md +0 -16
  55. data/lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb +0 -5
  56. data/lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt +0 -5
  57. data/lib/generators/react_on_rails/templates/base/base/client/.babelrc +0 -3
  58. data/lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md +0 -3
  59. data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/globals.jsx.tt +0 -5
  60. data/lib/generators/react_on_rails/templates/base/base/client/index.jade +0 -15
  61. data/lib/generators/react_on_rails/templates/base/base/client/npm-shrinkwrap.json +0 -2907
  62. data/lib/generators/react_on_rails/templates/base/base/client/package.json.tt +0 -98
  63. data/lib/generators/react_on_rails/templates/base/base/client/server.js +0 -64
  64. data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js.tt +0 -67
  65. data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.hot.config.js.tt +0 -67
  66. data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js +0 -41
  67. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +0 -28
  68. data/lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt +0 -26
  69. data/lib/generators/react_on_rails/templates/base/base/lib/tasks/linters.rake.tt +0 -88
  70. data/lib/generators/react_on_rails/templates/base/base/package.json +0 -31
  71. data/lib/generators/react_on_rails/templates/base/server_rendering/client/app/bundles/HelloWorld/startup/serverGlobals.jsx +0 -3
  72. data/lib/generators/react_on_rails/templates/base/server_rendering/client/webpack.server.rails.config.js +0 -40
  73. data/lib/generators/react_on_rails/templates/bootstrap/app/assets/stylesheets/_bootstrap-custom.scss +0 -63
  74. data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_post-bootstrap.scss +0 -10
  75. data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_pre-bootstrap.scss +0 -8
  76. data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_react-on-rails-sass-helper.scss +0 -19
  77. data/lib/generators/react_on_rails/templates/bootstrap/client/bootstrap-sass.config.js +0 -89
  78. data/lib/generators/react_on_rails/templates/dev_tests/.rspec +0 -2
  79. data/lib/generators/react_on_rails/templates/dev_tests/spec/features/hello_world_spec.rb +0 -25
  80. data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +0 -57
  81. data/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb +0 -21
  82. data/lib/generators/react_on_rails/templates/dev_tests/spec/spec_helper.rb +0 -95
  83. data/lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks +0 -2
  84. data/lib/generators/react_on_rails/templates/heroku_deployment/Procfile +0 -1
  85. data/lib/generators/react_on_rails/templates/heroku_deployment/config/puma.rb +0 -15
  86. data/lib/generators/react_on_rails/templates/js_linters/client/.eslintignore +0 -1
  87. data/lib/generators/react_on_rails/templates/js_linters/client/.eslintrc +0 -48
  88. data/lib/generators/react_on_rails/templates/js_linters/client/.jscsrc +0 -18
  89. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -39
  90. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -33
  91. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +0 -12
  92. data/lib/generators/react_on_rails/templates/no_redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx +0 -11
  93. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx +0 -8
  94. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -48
  95. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/constants/helloWorldConstants.jsx +0 -8
  96. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -43
  97. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx +0 -21
  98. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx +0 -14
  99. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +0 -21
  100. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/store/helloWorldStore.jsx +0 -35
  101. data/lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js +0 -20
  102. data/lib/generators/react_on_rails/templates/redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx +0 -21
  103. data/lib/generators/react_on_rails/templates/ruby_linters/.rubocop.yml +0 -26
  104. data/lib/generators/react_on_rails/templates/ruby_linters/.scss-lint.yml +0 -205
  105. data/lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/brakeman.rake +0 -17
  106. data/lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/ci.rake +0 -33
  107. data/lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml +0 -20
  108. data/lib/react_on_rails.rb +0 -6
  109. data/lib/react_on_rails/configuration.rb +0 -53
  110. data/lib/react_on_rails/engine.rb +0 -7
  111. data/lib/react_on_rails/prerender_error.rb +0 -31
  112. data/lib/react_on_rails/server_rendering_pool.rb +0 -111
  113. data/lib/react_on_rails/version.rb +0 -3
  114. data/rakelib/docker.rake +0 -33
  115. data/rakelib/dummy_apps.rake +0 -29
  116. data/rakelib/example_type.rb +0 -160
  117. data/rakelib/examples.rake +0 -103
  118. data/rakelib/examples_config.yml +0 -19
  119. data/rakelib/lint.rake +0 -37
  120. data/rakelib/run_rspec.rake +0 -65
  121. data/rakelib/task_helpers.rb +0 -44
  122. data/react_on_rails.gemspec +0 -31
  123. data/ruby-lint.yml +0 -24
@@ -1,31 +0,0 @@
1
- {
2
- "name": "react-webpack-rails-tutorial",
3
- "version": "1.1.1",
4
- "description": "Built using the react_on_rails generator. Allows you to run npm install from root.",
5
- "main": "server.js",
6
- "engines": {
7
- "node": "4.2.0",
8
- "npm": "3.3.6"
9
- },
10
- "scripts": {
11
- "postinstall": "cd client && npm install",
12
- "test": "rspec && (cd client && npm run lint)"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "https://github.com/shakacode/react-webpack-rails-tutorial.git"
17
- },
18
- "keywords": [
19
- "react",
20
- "tutorial",
21
- "comment",
22
- "example"
23
- ],
24
- "author": "justin808",
25
- "license": "MIT",
26
- "bugs": {
27
- "url": "https://github.com/shakacode/react-webpack-rails-tutorial/issues"
28
- },
29
- "homepage": "https://github.com/shakacode/react-webpack-rails-tutorial",
30
- "dependencies": {}
31
- }
@@ -1,3 +0,0 @@
1
- import HelloWorldAppServer from './HelloWorldAppServer';
2
-
3
- global.HelloWorldApp = HelloWorldAppServer;
@@ -1,40 +0,0 @@
1
- // Webpack configuration for server bundle
2
-
3
- const webpack = require('webpack');
4
- const path = require('path');
5
-
6
- const devBuild = process.env.NODE_ENV !== 'production';
7
- const nodeEnv = devBuild ? 'development' : 'production';
8
-
9
- module.exports = {
10
-
11
- // the project dir
12
- context: __dirname,
13
- entry: ['./app/bundles/HelloWorld/startup/serverGlobals', 'react', 'react-dom/server'],
14
- output: {
15
- filename: 'server-bundle.js',
16
- path: '../app/assets/javascripts/generated',
17
- },
18
- resolve: {
19
- extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', 'config.js'],
20
- alias: {
21
- lib: path.join(process.cwd(), 'app', 'lib'),
22
- },
23
- },
24
- plugins: [
25
- new webpack.DefinePlugin({
26
- 'process.env': {
27
- NODE_ENV: JSON.stringify('production'),
28
- },
29
- }),
30
- ],
31
- module: {
32
- loaders: [
33
- {test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
34
-
35
- // React is necessary for the client rendering:
36
- {test: require.resolve('react'), loader: 'expose?React'},
37
- {test: require.resolve('react-dom/server'), loader: 'expose?ReactDOMServer'},
38
- ],
39
- },
40
- };
@@ -1,63 +0,0 @@
1
- // This file loads Bootstrap by importing components explicitly instead of doing `@import 'bootstrap';`
2
- // Doing so allows for customization of exactly which components are imported.
3
- // The components themselves are made available via bootstrap-sass (https://github.com/twbs/bootstrap-sass#sass)
4
-
5
- // IMPORTANT: Make sure to keep the customizations defined in this file
6
- // in-sync with the ones defined in client/bootstrap-sass.config.js.
7
-
8
- // For a reference on customizations,refer to:
9
- // https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/_bootstrap.scss
10
-
11
- // If you are looking to merely change bootstrap variables from their default,
12
- // you should instead declare them in client/assets/stylesheets/_post-bootstrap.scss
13
-
14
- // Core variables and mixins
15
- @import 'bootstrap/variables';
16
- @import 'bootstrap/mixins';
17
-
18
- // Reset and dependencies
19
- @import 'bootstrap/normalize';
20
- @import 'bootstrap/print';
21
- @import 'bootstrap/glyphicons';
22
-
23
- // Core CSS
24
- @import 'bootstrap/scaffolding';
25
- @import 'bootstrap/type';
26
- @import 'bootstrap/code';
27
- @import 'bootstrap/grid';
28
- @import 'bootstrap/tables';
29
- @import 'bootstrap/forms';
30
- @import 'bootstrap/buttons';
31
-
32
- // Components
33
- @import 'bootstrap/component-animations';
34
- @import 'bootstrap/dropdowns';
35
- @import 'bootstrap/button-groups';
36
- @import 'bootstrap/input-groups';
37
- @import 'bootstrap/navs';
38
- @import 'bootstrap/navbar';
39
- @import 'bootstrap/breadcrumbs';
40
- @import 'bootstrap/pagination';
41
- @import 'bootstrap/pager';
42
- @import 'bootstrap/labels';
43
- @import 'bootstrap/badges';
44
- @import 'bootstrap/jumbotron';
45
- @import 'bootstrap/thumbnails';
46
- @import 'bootstrap/alerts';
47
- @import 'bootstrap/progress-bars';
48
- @import 'bootstrap/media';
49
- @import 'bootstrap/list-group';
50
- @import 'bootstrap/panels';
51
- @import 'bootstrap/responsive-embed';
52
- @import 'bootstrap/wells';
53
- @import 'bootstrap/close';
54
-
55
- // Components w/ JavaScript
56
- @import 'bootstrap/modals';
57
- @import 'bootstrap/tooltip';
58
- @import 'bootstrap/popovers';
59
- @import 'bootstrap/carousel';
60
-
61
- // Utility classes
62
- @import 'bootstrap/utilities';
63
- @import 'bootstrap/responsive-utilities';
@@ -1,10 +0,0 @@
1
- // The Rails server imports this file via app/assets/stylesheets/application.css.scss
2
- // The webpack HMR dev server loads this file via client/bootstrap-sass.config.js
3
-
4
- // In either case, this file is loaded AFTER bootstrap has been loaded.
5
- // This is where you can add your own styles and override bootstrap styles
6
- // utilizing bootstrap variables and mixins.
7
-
8
- .this-works {
9
- color: orange !important;
10
- }
@@ -1,8 +0,0 @@
1
- // The Rails server imports this file via app/assets/stylesheets/application.css.scss
2
- // The webpack HMR dev server loads this file via client/bootstrap-sass.config.js
3
-
4
- // In either case, this file is loaded BEFORE bootstrap has been loaded.
5
- // Use it to define variables BEFORE bootstrap loads. See http://getbootstrap.com/customize/
6
-
7
- // This is a file that provides a fallback for `img-url` and fonts
8
- @import 'react-on-rails-sass-helper';
@@ -1,19 +0,0 @@
1
- // The Rails server imports this file via app/assets/stylesheets/application.css.scss
2
- // The webpack HMR dev server loads this file via client/bootstrap-sass.config.js
3
-
4
- // This file allows the same sass code with Rails and node-sass for the Webpack Dev Server.
5
- // It is CRTICAL that this file is loaded first.
6
-
7
- $rails: false !default; // defaults to false (e.g. webpack environment)
8
-
9
- // Sass 3 removes image-url helper
10
- // https://github.com/sass/libsass/issues/489
11
- $image-url-path: '/assets/images/' !default;
12
-
13
- @function img-url($image) {
14
- @if $rails {
15
- @return image-url($image);
16
- } @else {
17
- @return url('#{$image-url-path}#{$image}');
18
- }
19
- }
@@ -1,89 +0,0 @@
1
- // See https://github.com/shakacode/bootstrap-sass-loader for more information
2
-
3
- // IMPORTANT: Make sure to keep the customizations defined in this file
4
- // in-sync with the ones defined in app/assets/stylesheets/_bootstrap-custom.scss.
5
-
6
- // For a reference on customizations,refer to:
7
- // https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/_bootstrap.scss
8
-
9
- module.exports = {
10
- bootstrapCustomizations: './assets/stylesheets/_pre-bootstrap.scss',
11
- mainSass: './assets/stylesheets/_post-bootstrap.scss',
12
-
13
- // Default for the style loading is to put in your js files
14
- // styleLoader: 'style-loader!css-loader!sass-loader',
15
-
16
- // See: https://github.com/sass/node-sass#outputstyle
17
- // https://github.com/sass/node-sass#imagepath
18
- styleLoader: 'style-loader!css-loader!sass-loader?imagePath=/assets/images',
19
-
20
- // ### Scripts
21
- // Any scripts here set to false will never make it to the client,
22
- // i.e. it's not packaged by webpack.
23
- scripts: {
24
- transition: true,
25
- alert: true,
26
- button: true,
27
-
28
- carousel: true,
29
- collapse: true,
30
- dropdown: true,
31
-
32
- modal: true,
33
- tooltip: true,
34
- popover: true,
35
- scrollspy: true,
36
- tab: true,
37
- affix: true,
38
- },
39
-
40
- // ### Styles
41
- // Enable or disable certain less components and thus remove
42
- // the css for them from the build.
43
- styles: {
44
- mixins: true,
45
-
46
- normalize: true,
47
- print: true,
48
-
49
- scaffolding: true,
50
- type: true,
51
- code: true,
52
- grid: true,
53
- tables: true,
54
- forms: true,
55
- buttons: true,
56
-
57
- 'component-animations': true,
58
- glyphicons: true,
59
- dropdowns: true,
60
- 'button-groups': true,
61
- 'input-groups': true,
62
- navs: true,
63
- navbar: true,
64
- breadcrumbs: true,
65
- pagination: true,
66
- pager: true,
67
- labels: true,
68
- badges: true,
69
-
70
- jumbotron: true,
71
- thumbnails: true,
72
- alerts: true,
73
-
74
- 'progress-bars': true,
75
- media: true,
76
- 'list-group': true,
77
- panels: true,
78
- wells: true,
79
- close: true,
80
-
81
- modals: true,
82
- tooltip: true,
83
- popovers: true,
84
- carousel: true,
85
-
86
- utilities: true,
87
- 'responsive-utilities': true,
88
- },
89
- };
@@ -1,2 +0,0 @@
1
- --color
2
- --format documentation
@@ -1,25 +0,0 @@
1
- require_relative "../rails_helper"
2
-
3
- feature "Hello World", js: true do
4
- scenario "the hello world example works" do
5
- visit "/hello_world"
6
- expect(heading).to have_text("Rendering")
7
- expect(message).to have_text("Stranger")
8
- name_input.set("John Doe")
9
- expect(message).to have_text("John Doe")
10
- end
11
- end
12
-
13
- private
14
-
15
- def name_input
16
- page.first("input")
17
- end
18
-
19
- def message
20
- page.first(:css, "h3")
21
- end
22
-
23
- def heading
24
- page.first(:css, "h1")
25
- end
@@ -1,57 +0,0 @@
1
- # This file is copied to spec/ when you run "rails generate rspec:install"
2
- ENV["RAILS_ENV"] ||= "test"
3
- require_relative "../config/environment"
4
- require_relative "simplecov_helper"
5
- # Prevent database truncation if the environment is production
6
- abort("The Rails environment is running in production mode!") if Rails.env.production?
7
- require_relative "spec_helper"
8
-
9
- # Add additional requires below this line. Rails is not loaded until this point!
10
-
11
- require "rspec/rails"
12
- require "capybara/rspec"
13
- require "capybara/rails"
14
-
15
- # Requires supporting ruby files with custom matchers and macros, etc, in
16
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
17
- # run as spec files by default. This means that files in spec/support that end
18
- # in _spec.rb will both be required and run as specs, causing the specs to be
19
- # run twice. It is recommended that you do not name files matching this glob to
20
- # end with _spec.rb. You can configure this pattern with the --pattern
21
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
22
- #
23
- # The following line is provided for convenience purposes. It has the downside
24
- # of increasing the boot-up time by auto-requiring all files in the support
25
- # directory. Alternatively, in the individual `*_spec.rb` files, manually
26
- # require only the support files necessary.
27
- #
28
- # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
29
-
30
- # Checks for pending migrations before tests are run.
31
- # If you are not using ActiveRecord, you can remove this line.
32
- # ActiveRecord::Migration.maintain_test_schema!
33
-
34
- RSpec.configure do |config|
35
- # Remove this line if you"re not using ActiveRecord or ActiveRecord fixtures
36
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
37
-
38
- # If you"re not using ActiveRecord, or you"d prefer not to run each of your
39
- # examples within a transaction, remove the following line or assign false
40
- # instead of true.
41
- config.use_transactional_fixtures = true
42
-
43
- # RSpec Rails can automatically mix in different behaviours to your tests
44
- # based on their file location, for example enabling you to call `get` and
45
- # `post` in specs under `spec/controllers`.
46
- #
47
- # You can disable this behaviour by removing the line below, and instead
48
- # explicitly tag your specs with their type, e.g.:
49
- #
50
- # RSpec.describe UsersController, :type => :controller do
51
- # # ...
52
- # end
53
- #
54
- # The different available types are documented in the features, such as in
55
- # https://relishapp.com/rspec/rspec-rails/docs
56
- config.infer_spec_type_from_file_location!
57
- end
@@ -1,21 +0,0 @@
1
- # Starts SimpleCov for code coverage.
2
-
3
- if ENV["COVERAGE"]
4
- require "simplecov"
5
-
6
- # Using a command name prevents results from getting clobbered by other test suites
7
- example_name = File.basename(File.expand_path("../../../.", __FILE__))
8
- SimpleCov.command_name(example_name)
9
-
10
- SimpleCov.start("rails") do
11
- # Consider the entire gem project as the root
12
- # (typically this will be the folder named "react_on_rails")
13
- gem_root_path = File.expand_path("../../../../.", __FILE__)
14
- root gem_root_path
15
-
16
- # Don't report anything that has "spec" in the path
17
- add_filter do |src|
18
- src.filename =~ %r{\/spec\/}
19
- end
20
- end
21
- end
@@ -1,95 +0,0 @@
1
- # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # The generated `.rspec` file contains `--require spec_helper` which will cause
4
- # this file to always be loaded, without a need to explicitly require it in any
5
- # files.
6
- #
7
- # Given that it is always loaded, you are encouraged to keep this file as
8
- # light-weight as possible. Requiring heavyweight dependencies from this file
9
- # will add to the boot time of your test suite on EVERY test run, even for an
10
- # individual file that may not need all of that loaded. Instead, consider making
11
- # a separate helper file that requires the additional dependencies and performs
12
- # the additional setup, and require it from the spec files that actually need
13
- # it.
14
- #
15
- # The `.rspec` file also contains a few flags that are not defaults but that
16
- # users commonly want.
17
- #
18
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
- RSpec.configure do |config|
20
- # rspec-expectations config goes here. You can use an alternate
21
- # assertion/expectation library such as wrong or the stdlib/minitest
22
- # assertions if you prefer.
23
- config.expect_with :rspec do |expectations|
24
- # This option will default to `true` in RSpec 4. It makes the `description`
25
- # and `failure_message` of custom matchers include text for helper methods
26
- # defined using `chain`, e.g.:
27
- # be_bigger_than(2).and_smaller_than(4).description
28
- # # => "be bigger than 2 and smaller than 4"
29
- # ...rather than:
30
- # # => "be bigger than 2"
31
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
- end
33
-
34
- # rspec-mocks config goes here. You can use an alternate test double
35
- # library (such as bogus or mocha) by changing the `mock_with` option here.
36
- config.mock_with :rspec do |mocks|
37
- # Prevents you from mocking or stubbing a method that does not exist on
38
- # a real object. This is generally recommended, and will default to
39
- # `true` in RSpec 4.
40
- mocks.verify_partial_doubles = true
41
- end
42
-
43
- # The settings below are suggested to provide a good initial experience
44
- # with RSpec, but feel free to customize to your heart's content.
45
- # rubocop:disable Style/BlockComments
46
- =begin
47
-
48
- # These two settings work together to allow you to limit a spec run
49
- # to individual examples or groups you care about by tagging them with
50
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
51
- # get run.
52
- config.filter_run :focus
53
- config.run_all_when_everything_filtered = true
54
-
55
- # Allows RSpec to persist some state between runs in order to support
56
- # the `--only-failures` and `--next-failure` CLI options. We recommend
57
- # you configure your source control system to ignore this file.
58
- config.example_status_persistence_file_path = "spec/examples.txt"
59
-
60
- # Limits the available syntax to the non-monkey patched syntax that is
61
- # recommended. For more details, see:
62
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
63
- # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
64
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
65
- config.disable_monkey_patching!
66
-
67
- # Many RSpec users commonly either run the entire suite or an individual
68
- # file, and it's useful to allow more verbose output when running an
69
- # individual spec file.
70
- if config.files_to_run.one?
71
- # Use the documentation formatter for detailed output,
72
- # unless a formatter has already been configured
73
- # (e.g. via a command-line flag).
74
- config.default_formatter = 'doc'
75
- end
76
-
77
- # Print the 10 slowest examples and example groups at the
78
- # end of the spec run, to help surface which specs are running
79
- # particularly slow.
80
- config.profile_examples = 10
81
-
82
- # Run specs in random order to surface order dependencies. If you find an
83
- # order dependency and want to debug it, you can fix the order by providing
84
- # the seed, which is printed after each run.
85
- # --seed 1234
86
- config.order = :random
87
-
88
- # Seed global randomization in this process using the `--seed` CLI option.
89
- # Setting this allows you to use `--seed` to deterministically reproduce
90
- # test failures related to randomization by passing the same `--seed` value
91
- # as the one that triggered the failure.
92
- Kernel.srand config.seed
93
- =end
94
- end
95
- # rubocop:enable Style/BlockComments