Ryuta Kamizono
892e38c78e
Enable Style/RedundantBegin
cop to avoid newly adding redundant begin block
...
Currently we sometimes find a redundant begin block in code review
(e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205 ).
I'd like to enable `Style/RedundantBegin` cop to avoid that, since
rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5
(https://bugs.ruby-lang.org/issues/12906 ), so we'd probably meets with
that situation than before.
2018-12-21 06:12:42 +09:00
Gannon McGibbon
886ac1c308
Remove redundant suffixes on generated helpers.
2018-12-12 12:22:59 -05:00
Pat Allan
acea68de02
Adding frozen_string_literal pragma to Railties.
2017-08-14 19:08:09 +02:00
Matthew Draper
87b3e226d6
Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
...
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e
Enforce frozen string in Rubocop
2017-07-01 02:11:03 +03:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
...
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Xavier Noria
783763bde9
applies new string literal convention in railties/test
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:16:09 +02:00
José Valim
e5e4d08450
Bring back the helpers tests
...
Also keep the hook as other tools may rely on it,
we just don't do anything by default on Rails.
2014-08-05 14:04:30 +02:00
David Heinemeier Hansson
a34b6649d0
Generating stubs for helper tests is overly specific. Most helpers should simply be tested as part of the view thats using them. If you need something beyond that, you can add a test yourself for them
2014-08-03 14:50:50 -07:00
Mike Moore
2a68f68aea
Update test locations
...
Change the default test locations to avoid confusion around the common
testing terms "unit" and "functional".
Add new rake tasks for the new locations, while maintaining backwards
compatibility with the old rake tasks.
New testing locations are as follows:
app/models -> test/models (was test/units)
app/helpers -> test/helpers (was test/units/helpers)
app/controllers -> test/controllers (was test/functional)
app/mailers -> test/mailers (was test/functional)
2012-10-09 17:53:56 -06:00
Akira Matsuda
cce461511b
be sure to parenthesize the arguments when the first one is a RegExp literal
...
this fixes: "warning: ambiguous first argument; put parentheses or even spaces"
because: you need this to tell the parser that you're not calling :/ method (division)
details (Japanese!): http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-dev/42445?42370-43277
2011-05-18 23:20:19 +09:00
José Valim
b61f6f5980
Load generators from both lib/rails/generators and lib/generators. Using the former since it's less obstrusive.
2010-03-23 13:40:41 +01:00
José Valim
a18dd52d58
Get generators tests running on Ruby 1.9.1
2010-01-19 01:36:06 +01:00
José Valim
9fffdc5cdb
Generators load path now will be Ruby load path. If you want to use rspec:install generator, you need generators/rspec/install_generator in your load path.
2010-01-18 16:21:11 +01:00
José Valim
271e7c803f
Move all generators tests to use new test case syntax.
2010-01-03 17:14:50 +01:00
Yehuda Katz
14370e1aab
CI breakage
...
This reverts commit a288b74f1c75c6f100de7611a5093a421f1ad6d1.
2009-11-02 17:12:01 -08:00
José Valim
a288b74f1c
Generators should use Rails.root instead of Dir.pwd [ #3408 status:resolved]
...
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-10-28 16:54:38 -04:00
Yehuda Katz + Carl Lerche
f0dd77c6be
Move railties/lib/* into railties/lib/*
2009-09-24 16:11:41 -07:00
José Valim
a06c825b46
Updated vendored Thor to 0.11.1 and update Rails::Generators.
2009-07-14 22:20:43 +02:00
José Valim
09c288f0c5
Add the new generators environment and update commands.
2009-07-08 12:55:50 +02:00
José Valim
d1c404ee90
Added lookup to generators.
2009-07-03 14:57:46 +02:00
José Valim
acaeaf308a
Add a fixture replacement hook to TestUnit model generator.
2009-06-27 21:29:59 +02:00
José Valim
8c5622f0d4
Initial scratch of model generators.
2009-06-27 21:29:59 +02:00
José Valim
2f3681dfc2
Clean up class collisions check and a class method helper.
2009-06-26 11:59:14 +02:00
José Valim
6bd101188e
Class collision checks.
2009-06-26 11:59:14 +02:00
José Valim
e084313640
Added HelperGenerator.
2009-06-26 11:59:13 +02:00