Commit Graph

26 Commits

Author SHA1 Message Date
Pedro Paiva 8837ef72df
Add Rails 7 (#1506) 2022-09-15 18:05:15 -03:00
Pedro Paiva 0cc461d4d9
Remove ruby 2.5 support (#1415)
* Remove Ruby 2.5 support

* Setting the target Ruby version to 2.6 on Rubocop

* Fix Style/SlicingWithRange: Prefer ary[n..] over ary[n..-1] offenses
2021-03-04 20:42:47 -03:00
Pedro Paiva ec93ea9052
Remove Ruby 2.4 support (#1412)
* Remove Ruby 2.4 support

* Fix: Style/RedundantBegin: Redundant begin block detected
2021-02-11 08:58:16 -03:00
Pedro Paiva bf850fa043
Add GitHub Action to replace Travis (#1397) 2021-01-25 18:57:22 -03:00
Kapil Sachdev b7e02184d9 fix(rubocop): Fix Layout/LineLength
- bump rubocop to v1.0
- Fix Layout/MultilineAssignmentLayout and other remaining offences
- Exculde appraisal generated gemfiles in rubocop
- Replace NON_NUMERIC_VALUE constant with instance method against 
failing test case in  rails <= 5.1 and postgres adapter.
This is a defect in rails where a frozen string is modified in 
https://github.com/rails/rails/blob/v5.1.7/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb#L25
2020-11-03 10:05:25 -07:00
Kapil Sachdev 3e88500318 fix(rubocop): Fix Style, Layout, Lint and other offenses [ci skip]
Updated Layout/LineLength cop to Max 120 lenght and ignore everything 
inside specs/**/*

Added rules for below cops in .rubocop.yml
Lint/AmbiguousBlockAssociation
Naming/HeredocDelimiterNaming
Rails/SkipsModelValidations
Style/FormatStringToken


Fixed below mentioned cops:
- Layout/CaseIndentation
- Layout/DotPosition
- Layout/ElseAlignment
- Layout/IndentationWidth
- Layout/LineLength
- Layout/MultilineBlockLayout
- Layout/MultilineOperationIndentation
- Lint/AmbiguousBlockAssociation
- Lint/MissingCopEnableDirective
- Lint/NestedMethodDefinition
- Lint/RedundantCopDisableDirective
- Lint/RedundantRequireStatement
- Lint/UnusedBlockArgument
- Lint/UnusedMethodArgument
- Metrics/ModuleLength
- Naming/MemoizedInstanceVariableName
- Naming/RescuedExceptionsVariableName
- Rails/Output
- Rails/Presence
- Security/Eval
- Security/Open
- Style/ClassCheck
- Style/CollectionMethods
- Style/ConditionalAssignment
- Style/EvalWithLocation
- Style/FormatStringToken
- Style/InverseMethods
- Style/MutableConstant
- Style/ParallelAssignment
- Style/RedundantBegin
- Style/RedundantCondition
- Style/RedundantInterpolation
- Style/RedundantSelf
- Style/RedundantSort
- Style/RescueStandardError
- Style/SafeNavigation
- Style/StringLiteralsInInterpolation
- Style/SymbolProc
2020-11-03 10:05:25 -07:00
Kapil Sachdev ee1008de7a fix(rubocop): Fix Layout related offenses [ci skip]
- Layout/EmptyLines
- Layout/EmptyLineAfterGuardClause
- Layout/TrailingEmptyLines
- Layout/EmptyLinesAroundBlockBody
- Layout/EmptyLinesAroundModuleBody
- Layout/EmptyLineAfterMagicComment
- Layout/SpaceInsidePercentLiteralDelimiters
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceInsideArrayLiteralBrackets
- Layout/LeadingCommentSpace
- Layout/SpaceBeforeComment
- Layout/SpaceAroundOperators
- Layout/SpaceInsideRangeLiteral
- Layout/SpaceInsideReferenceBrackets
- Layout/SpaceInLambdaLiteral
- Layout/SpaceAfterComma
- Layout/SpaceInsideHashLiteralBraces
- Layout/TrailingWhitespace
- Layout/ArgumentAlignment
- Layout/HashAlignment
- Layout/DotPosition
- Layout/IndentationWidth
- Layout/EndAlignment
- Layout/MultilineOperationIndentation
- Layout/IndentationConsistency
- Layout/ClosingHeredocIndentation
- Layout/MultilineMethodCallBrace- Layout
- Layout/ClosingParenthesisIndentation
2020-11-03 10:05:25 -07:00
Kapil Sachdev 0acc27eaac fix(rubocop): Satisfy Style/EmptyMethod [ci skip] 2020-11-03 10:05:25 -07:00
Kapil Sachdev cdcef128cf fix(rubocop): Add trailing comma in args, Hash and Arrays [ci skip]
- Satisfies Style/TrailingCommaInArguments, 
Style/TrailingCommaInArrayLiteral and Style/TrailingCommaInHashLiteral
2020-11-03 10:05:25 -07:00
Kapil Sachdev 97722f67cb fix(rubocop): Satisfy Style/StringLiterals with single_quotes [ci skip] 2020-11-03 10:05:25 -07:00
Bill Ruddock 2a4ef99020 Fix spec runner: read command output during run
IO.pipe buffers 4096 bytes. If the command output fills that up,
Process.waitpid will hang waiting for the spawned process to finish.

Read command output from the pipe in a thread. This thread will self-exit
when the pipe is closed.

Fixes #1287
2020-05-12 23:07:16 -06:00
Joey Cheng 7dd35a4460 Configure database for multi-db testing
* In current database.yml config, all database environments are sharing same database. Suffix database name with relevant environment name to ensure database uniqueness
* Update Rails migration command to `db:drop:all` and `db:create:all`, so all db listed in config/database.yml is dropped/created accordingly
* Write a base ActiveRecord model that connects to different database (production database)
* Write a base ActiveRecord model that connects to default database (development database), this is a dummy model, just for symmetry's sake
2019-05-23 21:57:21 -06:00
Elliot Winkler abf0d96b60 Ensure that the correct Bundler is used to run acceptance tests 2019-03-20 22:59:52 -07:00
Elliot Winkler 96a6eb2cfe Upgrade Appraisal to 2.2.0 2018-01-24 00:30:10 -06:00
Elliot Winkler 70eaedf587 Fix broken acceptance tests
Bundler 1.6.0 made a change which prohibits you from running `bundle
init` from a directory from which Bundler is able to find a Gemfile by
ascending the file tree. This breaks our acceptance tests because some
of them create a directory and then run `bundle init` in order to
bootstrap that directory as a fresh Bundler project.
2017-11-08 23:04:58 -06:00
Elliot Winkler 3ee734bb7e Speed up running unit tests with Zeus
This is an effort to vastly decrease the time it takes to run a single
unit test file and therefore increase productivity and happiness for
people working on this project.

If you want to run a unit test file, now you can use `zeus rspec`
instead of `rspec` -- assuming you run `zeus start` first -- and it will
run a LOT faster.

Because test files tend to have long file paths, you can even use a
shorter version of those paths. So instead of saying:

    zeus rspec spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb

you can say:

    zeus rspec active_record/validate_uniqueness_of_matcher_spec.rb
2015-12-13 20:22:21 -07:00
Elliot Winkler 15091726fe Improve contributing workflow
* Add missing steps to CONTRIBUTING and reorganize it a bit.
* `bundle exec rake` no longer runs all tests in all appraisals, only
  the tests in the latest appraisal.
* Add a `.ruby-version` file so people don't have to figure out which
  version of Ruby to install.

[ci skip]
2015-10-30 11:24:15 -06:00
Elliot Winkler e0a0200fe4 Make independent matchers really independent
Why:

* When `delegate_method` was modified a while back to add Doublespeak
  and use MatcherContext, Shoulda::Matchers::Independent became unable
  to be required independently.

To satisfy the above:

* Require Doublespeak and MatcherContext within
  `delegate_method_matcher.rb`.
* Add an acceptance test to ensure that Independent stays independent.

Secondary-Author: jc00ke <jesse@jc00ke.com>
2015-10-01 10:12:17 -06:00
Elliot Winkler 445a3ea482 CommandRunner: if command fails, format it better 2015-02-12 17:35:37 -07:00
Elliot Winkler 74fa081ef5 Stop testing against columns unsupported by SQLite 2015-02-12 16:05:46 -07:00
Elliot Winkler 72f60fae94 Add support for Postgres
When running tests, you can now switch between running them against a
SQLite or PostgreSQL database. This is accomplished by modifying the
unit and acceptance tests so that when they generate and load the test
Rails application, database.yml is replaced with content that will
configure the database appropriately.
2015-02-12 16:01:00 -07:00
Elliot Winkler 942a600e07 Changes to CommandRunner
* Use full output instead of elided output on failure
* Refactor debugging code a bit
* Use :chdir option to Process.spawn instead of Dir.chdir
2015-02-12 15:24:40 -07:00
Elliot Winkler 9a903f523c Raise an error if no Appraisal is specified
If you attempt to run tests without specifying an Appraisal, then you
will be going off of the main Gemfile. The Gemfile is not guaranteed to
contain all of the dependencies necessary to run tests, so it is very
likely that you'll get an obscure error somewhere. Instead of letting
this happen, raise a specific error.
2015-02-05 18:03:32 -07:00
Elliot Winkler 021d3d6ec8 Fix acceptance tests to actually remove gems 2015-02-05 10:20:11 -07:00
Elliot Winkler 0da09b2132 Clean up acceptance tests a bit 2014-11-05 16:39:08 -07:00
Elliot Winkler 3fb4cdb3b7 Add new RSpec acceptance tests to replace Cucumber 2014-11-05 09:53:33 -07:00