1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
Commit graph

21 commits

Author SHA1 Message Date
Vasiliy
8ae87a87f3
Setup Rubocop (#1537)
* Initialize rubocop

* Style/StringLiterals: prefer single quotes

* Style/AndOr: use `&&` and `||`, instead of `and` and `or`

* Style/HashSyntax: use new hash syntax

* Layout/EmptyLineAfterGuardClause: add empty lines after guard clause

* Style/SingleLineMethods: temporary disable

It breaks layout of the code, it is better to fix it manually

* Style/Proc: prefer `proc` vs `Proc.new`

* Disable Lint/AmbiguousBlockAssociation

It affects proc definitions for sinatra DSL

* Disable Style/CaseEquality

* Lint/UnusedBlockArgument: put underscore in front of it

* Style/Alias: prefer alias vs alias_method in a class body

* Layout/EmptyLineBetweenDefs: add empty lines between defs

* Style/ParallelAssignment: don't use parallel assigment

* Style/RegexpLiteral: prefer %r for regular expressions

* Naming/UncommunicativeMethodParamName: fix abbrevs

* Style/PerlBackrefs: disable cop

* Layout/SpaceAfterComma: add missing spaces

* Style/Documentation: disable cop

* Style/FrozenStringLiteralComment: add frozen_string_literal

* Layout/AlignHash: align hash

* Layout/ExtraSpacing: allow for alignment

* Layout/SpaceAroundOperators: add missing spaces

* Style/Not: prefer `!` instead of `not`

* Style/GuardClause: add guard conditions

* Style/MutableConstant: freeze contants

* Lint/IneffectiveAccessModifier: disable cop

* Lint/RescueException: disable cop

* Style/SpecialGlobalVars: disable cop

* Layout/DotPosition: fix position of dot for multiline method chains

* Layout/SpaceInsideArrayLiteralBrackets: don't use spaces inside arrays

* Layout/SpaceInsideBlockBraces: add space for blocks

* Layout/SpaceInsideHashLiteralBraces: add spaces for hashes

* Style/FormatString: use format string syntax

* Style/StderrPuts: `warn` is preferable to `$stderr.puts`

* Bundler/DuplicatedGem: disable cop

* Layout/AlignArray: fix warning

* Lint/AssignmentInCondition: remove assignments from conditions

* Layout/IndentHeredoc: disable cop

* Layout/SpaceInsideParens: remove extra spaces

* Lint/UnusedMethodArgument: put underscore in front of unused arg

* Naming/RescuedExceptionsVariableName: use `e` for exceptions

* Style/CommentedKeyword: put comments before the method

* Style/FormatStringToken: disable cop

* Style/MultilineIfModifier: move condition before the method

* Style/SignalException: prefer `raise` to `fail`

* Style/SymbolArray: prefer %i for array of symbols

* Gemspec/OrderedDependencies: Use alphabetical order for dependencies

* Lint/UselessAccessModifier: disable cop

* Naming/HeredocDelimiterNaming: change delimiter's name

* Style/ClassCheck: prefer `is_a?` to `kind_of?`

* Style/ClassVars: disable cop

* Style/Encoding: remove coding comment

* Style/RedundantParentheses: remove extra parentheses

* Style/StringLiteralsInInterpolation: prefer singl quotes

* Layout/AlignArguments: fix alignment

* Layout/ClosingHeredocIndentation: align heredoc

* Layout/EmptyLineAfterMagicComment: add empty line

* Set RubyVersion for rubocop

* Lint/UselessAssignment: disable cop

* Style/EmptyLiteral: disable cop

Causes test failures

* Minor code-style fixes with --safe-auto-correct option

* Disable the rest of the cops that cause warnings

It would be easier to re-enable them in separate PRs

* Add rubocop check to the default Rake task

* Update to rubocop 1.32.0

* Rubocop updates for rack-protection and sinatra-contrib

* Disable Style/SlicingWithRange cop

* Make suggested updates

Co-authored-by: Jordan Owens <jkowens@gmail.com>
2022-07-31 08:56:44 -04:00
Eloy Pérez
5f95f553ab Disable monkey patch in RSpec for sinatra-contrib 2022-02-05 13:28:39 +01:00
Jordan Owens
e3d96ee91f Revert back to using include matcher
A regression was fixed in Rspec so the include matcher once again
works as expected.
2018-10-10 12:43:43 -04:00
Kunpei Sakai
b7c10649ca
prefer be_include over have_key in this case 2018-09-15 23:13:08 +09:00
Kunpei Sakai
1d4b458f6f
use have_key instead of include to avoid failing spec
In rspec-3.8.0, the `include` matcher with hash like object doesn't work
correctly.
See: https://github.com/rspec/rspec-expectations/issues/1068
2018-09-15 17:55:05 +09:00
Olle Jonsson
698824c09f Spec: Remove unused local 'seen' 2017-08-27 11:42:34 +02:00
Andrew Allen
7c71684610 adds explicit set method to contrib/cookies 2017-01-24 13:40:53 -08:00
Zachary Scott
c4c08c23d7 Merge branch 'rspec' of https://github.com/stjhimy/sinatra-contrib into stjhimy-rspec 2016-07-20 14:19:41 +09:00
stjhimy
8003802307 Migrate to rspec 3.4 2016-06-21 15:12:09 -03:00
stjhimy
c0142101c8 Remove ruby 1.8/1.9 version check 2016-05-09 11:49:42 -03:00
Zachary Scott
b79197443f Don't set cookie domain on localhost from #118
Closes #113
Closes #115
2015-05-22 15:40:08 -07:00
Ashley Williams
60dd845326 fix specs to account for deprecation notices
- use `be true` instead of `be_true`
- use `be false` instead of `be_false`
2015-05-15 14:59:42 -04:00
Bo Jeanes
5e01e0db22 Limit backports usage in specs 2014-05-12 19:59:19 -07:00
Konstantin Haase
7afb500422 fix cookie extension for Rack 1.5 2013-03-16 15:18:55 +01:00
Trevor Bramble
a03684c4ef Reverting due to Ruby 1.8.7 incompatibility
Revert "Merge pull request #66 from kylewlacy/master"

This reverts commit 1ad87b6730064300234c6796f214c9eb8c895efa, reversing
changes made to 21415118af38224ca34948ef0b621b57c1201820.
2013-02-20 02:01:16 -08:00
Trevor Bramble
b5293a7a6f Merge pull request #66 from kylewlacy/master
Modify cookie[]= method to support additional options
2013-02-20 01:35:47 -08:00
Thibaut Sacreste
d83b594a3c cookies.delete honours the app cookie options 2012-11-09 14:07:40 +00:00
Kyle Lacy
f69d7fad03 modify cookie[]= to support extra cookie options
Using the syntax `cookie[:key, :options => 'hash']='value'`` will now
merge the provided hash with the existing @options hash (which allows
for changing cookie options on a per-cookie basis).
2012-09-22 21:05:42 -07:00
Rafael Magana
8cdb462af8 fix spec: Sinatra::Cookies fetch raises an exception if key does not exist in JRuby, IndexError was expected instead of KeyError 2012-06-11 17:27:40 -05:00
Konstantin Haase
ac40d671b8 remove hash spec, this is way too inconsisten between rubies 2011-09-05 00:41:36 -07:00
Konstantin Haase
57430546e2 add cookies extension 2011-09-04 18:13:40 -07:00