Commit Graph

16 Commits

Author SHA1 Message Date
Michael Grosser 203998c916
allow running each test with pure ruby path/to/test.rb
also:
 - makes test dependencies obvious
 - makes tests runnable from within subfolders
2019-12-18 08:49:19 -06:00
Yasuo Honda e4a6a23aa7 Suppress `warning: BigDecimal.new is deprecated`
`BigDecimal.new` has been deprecated in BigDecimal 1.3.3
 which will be a default for Ruby 2.5.

Refer
533737338d

* This commit has been made as follows:

```
cd rails
git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g"
```
- `activesupport/test/xml_mini_test.rb`
Editmanually to remove `.new` and `::`

- guides/source/5_0_release_notes.md
This is a Rails 5.0 release notes.
2017-12-15 01:19:57 +00:00
Koichi ITO ac717d65a3 [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` 2017-07-11 13:12:32 +09:00
Kir Shatrov 72950568dd Use frozen-string-literal in ActiveSupport 2017-07-09 15:08:29 +03:00
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Xavier Noria a731125f12 applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
Yosuke Kabuto 330e011c6c Add some assertions for BigDecimal#to_s 2016-05-15 14:49:53 +09:00
David Celis c87b27ebde Remove BigDecimal#to_d
This was backported for Ruby 1.8 support and is no longer needed.

Signed-off-by: David Celis <me@davidcel.is>
2014-02-01 10:45:57 -08:00
David Celis 85d820b169 Don't require BigDecimal serialization extension
Rails currently provides an extension to BigDecimal that redefines how
it is serialized to YAML. However, as noted in #12467, this does not
work as expected. When ActiveSupport is required, BigDecimal YAML
serialization does not maintain the object type. It instead ends up
serializing the number represented by the BigDecimal itself which, when
loaded by YAML later, becomes a Float:

```ruby
require 'yaml'
require 'bigdecimal'

yaml = BigDecimal('13.37').to_yaml
YAML.load(yaml).class

require 'active_support/all'

yaml = BigDecimal('13.37').to_yaml
YAML.load(yaml).class
```

@tenderlove posits that we should deprecate the custom BigDecimal
serialization and let Ruby handle it. For the time being, users who
require this serialization for backwards compatibility can manually
`require 'active_support/core_ext/big_decimal/yaml_conversions'`.

This will close #12467 and deprecate the custom BigDecimal#to_yaml.

Signed-off-by: David Celis <me@davidcel.is>
2014-02-01 10:45:51 -08:00
Anupam Choudhury f3e4069ede Removed unnecessary require 2013-09-10 13:22:30 +05:30
Andrew Mutz 155cd5e6b5 Moving NumberHelpers from ActionView to ActiveSupport 2012-05-27 18:14:21 -07:00
Aaron Patterson b8d8c50785 use AS::TestCase as the base class 2012-01-05 17:12:46 -08:00
Aaron Patterson 2570c85cb7 fixing psych support in big decimal, fixing tests to support YAML 1.1 2011-01-21 11:16:40 -08:00
Josh Kalderimis 199e220e88 Fixed various isolated test missing requires within AS.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-01-12 12:37:28 -02:00
Aaron Patterson 1cc556dc52 adding to_d to BigDecimal 2011-01-10 15:51:37 -08:00