aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/module
Commit message (Collapse)AuthorAgeFilesLines
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-253-21/+21
|
* Use respond_to test helpersDaniel Colson2018-01-254-14/+14
|
* removed unnecessary returnsShuhei Kitagawa2017-10-281-4/+4
|
* Deprecate `Module#reachable?` methodbogdanvlviv2017-09-171-10/+18
|
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-119-0/+9
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-099-0/+9
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-029-9/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-019-0/+9
|
* Implement mattr_acessor :default optionGenadi Samokovarov2017-06-031-1/+37
|
* Correct spellingBenjamin Fleischer2017-02-051-2/+2
| | | | | | | ``` go get -u github.com/client9/misspell/cmd/misspell misspell -w -error -source=text . ```
* Adjust `Module.parent_name` to work when frozen; fixes #27637Corey Ward2017-01-171-0/+37
|
* assert_equal takes expectation firstAkira Matsuda2016-12-261-3/+3
|
* Remove deprecated Module.qualified_const_get/set/defined?Andrew White2016-11-141-118/+0
|
* improve error message when include assertions failMichael Grosser2016-09-161-3/+3
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* Add three new rubocop rulesRafael Mendonça França2016-08-163-9/+9
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Merge pull request #25681 from willnet/fix-thread_mattr_accessorYves Senn2016-08-081-0/+16
|\ | | | | | | Fix `thread_mattr_accessor` share variable superclass with subclass
| * Fix `thread_mattr_accessor` share variable superclass with subclasswillnet2016-08-041-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of `thread_mattr_accessor` set variable sharing superclass with subclass. So the method doesn't work as documented. Precondition class Account thread_mattr_accessor :user end class Customer < Account end Account.user = "DHH" Account.user #=> "DHH" Customer.user = "Rafael" Customer.user # => "Rafael" Documented behavior Account.user # => "DHH" Actual behavior Account.user # => "Rafael" Current implementation set variable statically likes `Thread[:attr_Account_user]`, and customer also use it. Make variable name dynamic to use own thread-local variable.
* | code gardening: removes redundant selfsXavier Noria2016-08-081-8/+8
| | | | | | | | | | | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* | applies remaining conventions across the projectXavier Noria2016-08-061-2/+0
| |
* | normalizes indentation and whitespace across the projectXavier Noria2016-08-064-10/+10
| |
* | modernizes hash syntax in activesupportXavier Noria2016-08-061-3/+3
| |
* | applies new string literal convention in activesupport/testXavier Noria2016-08-069-48/+48
|/ | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix `thread_mattr_accessor` thread-local variable namingMichael Ryan2016-03-111-0/+6
| | | | | | | | | | | | | | | | | The current implentation of `thread_mattr_accessor` is setting differently-named thread variables when defining class and instance writer methods, so the method isn't working as documented: Account.user = "DHH" Account.user # => "DHH" Account.new.user # => nil a = Account.new a.user = "ABC" # => "ABC" a.class.user # => "DHH" At this point `:attr_Account_user` and `:attr_Class_user` thread-local variables have been created. Modify the reader and writer methods to use the class name instead of 'Class'.
* Use separate test class nameDavid Heinemeier Hansson2015-12-171-1/+1
|
* Add thread_m/cattr_accessor/reader/writer suite of methods for declaring ↵David Heinemeier Hansson2015-12-171-0/+109
| | | | class and module variables that live per-thread
* Don't leak Object constants in core_ext/module/qualified_constGenadi Samokovarov2015-12-161-60/+70
|
* Make `Module#redefine_method` to keep method visibilityyui-knk2015-10-261-1/+19
| | | | | | | Before this commit `Module#redefine_method` always changes visibility of redefined method to `public`. This commit changes behavior of Module#redefine_method` to keep method visibility.
* Add Module#remove_possible_singleton_methodAndrew White2015-10-211-3/+15
| | | | | This is primarily to fix method redefinition warnings in class_attribute but may be of use in other places where we define singleton methods.
* Regex fix for mattr_accessor validationAliaksandr Buhayeu2015-10-011-0/+14
| | | | | Change ^ and $ operators to \A and \z to prevent code injection after the line breaks
* Only invoke the default block for mattr_accessor once so that it does not ↵Lachlan Sylvester2015-08-071-0/+6
| | | | cause issues if it is not idempotent
* Introduce Concern#class_methods and Kernel#concernJeremy Kemper2014-02-231-14/+44
|
* Introduce Module#concerningJeremy Kemper2013-12-171-0/+35
| | | | | | A natural, low-ceremony way to separate responsibilities within a class. Imported from https://github.com/37signals/concerning#readme
* Unify cattr and mattr accessors declarationsGenadi Samokovarov2013-12-021-4/+22
|
* Fix some assert_raise calls containing messages in Active SupportCarlos Antonio da Silva2012-10-281-6/+13
|
* Fix ActiveSupport tests that depend on run orderFrancesco Rodriguez2012-08-231-11/+18
|
* validate attribute names in class and module attribute accessorsDmitry Plashchynski2012-03-301-0/+14
|
* use AS::TestCase as the base classAaron Patterson2012-01-053-3/+3
|
* Module#synchronize is deprecated with no replacement. Please use `monitor` ↵Aaron Patterson2011-11-291-89/+0
| | | | from ruby's standard library.
* added remove_method core_ext testsAnand2011-11-071-0/+29
|
* defines Module#qualified_const_(defined?|get|set) and String#deconstantizeXavier Noria2011-10-291-0/+94
| | | | | | | | | | This commit also implements a faster version of #demodulize I was unable to isolate with git add --patch. Not a big fan of the name #deconstantize. It complements #demodulize getting rid of the rightmost constant, hence the name, but it is unrelated to the well-known #constantize. So unsure. Could not come with anything better, please feel free to rename.
* Added instance_accessor: false to Module#mattr_accessorVijay Dev2011-06-141-0/+7
|
* Removed deprecated methods and related tests from ActiveSupportJosh Kalderimis2011-05-251-39/+0
|
* Deprecate attr_accessor_with_default.José Valim2011-05-161-4/+12
|
* Don't depend on rubygems loading thread (for Mutex)raggi2010-11-251-0/+1
|
* attr_accessor_with_default should raise an ArgumentError not a RuntimeErrorAaron Patterson2010-09-241-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-145-17/+17
| | | | 's/[ \t]*$//' -i {} \;)
* Final iteration of use better testing methodsNeeraj Singh2010-05-192-7/+7
| | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* fixing inconsistency with cattr_reader and matter_reader [#4172 state:resolved]Kabari Hendrick2010-03-271-0/+6
| | | Signed-off-by: wycats <wycats@gmail.com>
* moves Class#reachable? to Module#reachable?, bases implementation on ↵Xavier Noria2010-02-111-0/+41
| | | | anonymous? and constantize, and adds test coverage
* defines Module#anonymous?Xavier Noria2010-02-111-0/+14
|