Commit Graph

2250 Commits

Author SHA1 Message Date
Pavel Pravosud
0cb3cc4ff7 Add implicit receiver support to Object#with_options 2014-07-29 16:11:48 -04:00
Akshay Vishnoi
6bc7e27c19 Add missing test case for Array#to_sentence, collect all test cases for Object#to_param at one place and avoid repitition 2014-07-29 20:05:36 +05:30
Rafael Mendonça França
8426897086 Merge pull request #16334 from akshay-vishnoi/array-tests
Move array test files under array
2014-07-29 10:59:53 -03:00
Akshay Vishnoi
00979fdb2c Move array test files under array 2014-07-29 18:13:52 +05:30
Godfrey Chan
5de072c730 Added failing test case for #16131 2014-07-29 00:04:36 -07:00
Rafael Mendonça França
6924f848c4 Merge pull request #15629 from akshay-vishnoi/test-to_param
Define Hash#to_query and set Hash#to_param as alias to it; with test cases
2014-07-28 20:51:21 -03:00
Akshay Vishnoi
a45d1f6dfd Move object test files under object 2014-07-29 05:01:50 +05:30
Arthur Neves
c17c262cfc
Make HWIA copy the default proc too.
[fixes #16279]
2014-07-24 11:48:24 -04:00
Rafael Mendonça França
cee2c85b07 Merge pull request #16232 from egilburg/activesupport_coverage
Added some missing activesupport test coverage
2014-07-21 14:25:51 -03:00
Akshay Vishnoi
4b2eb17bb2 Remove not-required file class/subclasses 2014-07-21 15:46:53 +05:30
Eugene Gilburg
3b9cc0a56f missing activesupport test coverage 2014-07-19 17:15:40 -07:00
Rafael Mendonça França
08754f12e6 Merge branch 'rm-remove-mocha'
Conflicts:
	actionpack/test/abstract_unit.rb
2014-07-19 18:17:13 -03:00
Rafael Mendonça França
fd6aaaa0c3 Stop requiring mocha automatically
We are planning to remove mocha from our test suite because of
performance problems. To make this possible we should stop require mocha
on ActionSupport::TestCase.

This should not affect applications since users still need to add mocha
to Gemfile and this already load mocha.

Added FIXME notes to place that still need mocha removal
2014-07-19 17:35:12 -03:00
Aaron Patterson
5737c8e24b fix thread safety issues
this test case had a race condition where it could download data
multiple times.  We'll download the data once at class load.
2014-07-17 15:36:42 -07:00
Jon Atack
fc2ecbb844 Fix typos in string_ext_test.rb [ci skip] 2014-07-16 22:02:36 +02:00
Matthew Draper
41679b2b31 Merge pull request #16190 from oss92/word_truncation
Word truncation
2014-07-17 04:31:53 +09:30
root
a9d3b77e49 Added truncate_words method to activesupport strings 2014-07-16 19:48:07 +02:00
Rafael Mendonça França
19fae86fe0 Move uuid_v5 and uuid_v3 to Digest::UUID
These methods are not random so they should not belings to SecureRandom
module.
2014-07-15 19:51:33 -03:00
Rafael Mendonça França
3121412cf1 Keep quietly and capture undeprecated on your suite 2014-07-15 17:56:27 -03:00
Erik Michaels-Ober
f0fc49d256 Fix tests broken in https://github.com/rails/rails/pull/16149 2014-07-12 19:05:39 +02:00
Erik Michaels-Ober
f1bad130d0 Return an Enumerator if no block is given 2014-07-12 18:22:43 +02:00
Robin Dupret
a563f013d4 Silence the output downloading a file
This output isn't used anywhere for assertions so we can simply remove
it. The introducing commit was f238d495.
2014-07-11 22:02:16 +02:00
Matthew Draper
3f2ec19c21 Don't fail if unicode.org isn't talking to us 2014-07-05 03:56:19 +09:30
John Paul Ashenfelter
d75992b0b2 DateTime#to_f now preserves fractional seconds.
Previously this method always returns `.0` in the fractional part. This commit
changes it to preserve the fractional seconds instead.

Fixes #15994.
2014-07-02 15:01:35 -07:00
Sean Griffin
b2cf8b251a Add Hash#map_values to ActiveSupport
Didn't get a chance to convert existing code, I'll skim through the code
base to make use of this later this afternoon.
2014-06-29 13:31:43 -06:00
Robin Dupret
643409dcb0 Make the apply_inflections method case-sensitive
Since d3071db1, the apply_inflections method check if the downcased
version of a string is contained inside the "whitelist" of uncountable
words. However, if the word is composed of capital letters, it won't be
matched in the list while it should.

We can't simply revert to the previous behavior as there is a
performance concern (benchmarked over /usr/share/dict/words):

Before d3071db1  135.610000   0.290000  135.900000 (137.807081)
Since d3071db1   22.170000    0.020000  22.190000  ( 22.530005)
With the patch   22.060000    0.020000  22.080000  ( 22.125771)

Benchmarked with http://git.io/aFnWig

This way, the solution is to put the down-case version of words inside
the @uncountables array.
2014-06-26 14:03:56 +02:00
Yuki Nishijima
98f0cab396 Fix a bug where NameError#name returns a qualified name in string
Ruby's original behaviour is that :

  * It only returns a const name, not a qualified aname
  * It returns a symbol, not a string
2014-06-24 10:13:17 -07:00
Zuhao Wan
023d14ecbb Create with_env helper for tests. 2014-06-22 20:31:34 +08:00
Yves Senn
e32dade866 Merge pull request #15856 from zuhao/refactor_activesupport_decoding_test
Use with_parse_json_times helper in tests.
2014-06-22 13:47:25 +02:00
Zuhao Wan
42b33590f3 Avoid hardcoded magic number in test teardown. 2014-06-22 18:36:07 +08:00
Zuhao Wan
17ad556a3f Use with_parse_json_times helper in tests. 2014-06-22 18:30:44 +08:00
Arthur Neves
bd3fde0931
Add regression test for NameError#name 2014-06-20 09:55:41 -04:00
Akshay Vishnoi
c420a8daf5 Move to_param to to_query, also Improve tests 2014-06-20 03:46:18 +05:30
Yves Senn
911b282cf0 Merge pull request #15799 from zuhao/refactor_activesupport_time_zone_test_helpers
Extract out with_env_tz helper method.
2014-06-18 13:59:57 +02:00
Zuhao Wan
9c492885d1 Extract out with_env_tz helper method.
It’s used at so many places that extracting it out into a helper file
is worth doing.
2014-06-18 19:46:04 +08:00
Zuhao Wan
0c2fbc5095 Move test teardown into ensure block. 2014-06-17 20:57:02 +08:00
Rafael Mendonça França
d8569bd498 Merge pull request #15684 from aditya-kapoor/add-tests-for-assert-valid-keys
Add test cases for Hash#asset_valid_keys
2014-06-16 13:27:59 -03:00
Kuldeep Aggarwal
880721434c remove unnecessary calling of I18n.backend.store_translations(empty, {})
Clean up I18n stored translations after test
continuation with #15714
2014-06-15 08:53:58 +05:30
Aditya Kapoor
fedb16ae12 Add test cases for Hash#asset_valid_keys 2014-06-14 14:13:06 +05:30
Akshay Vishnoi
bb5c1321d6 Add missing test cases for #assert_no_difference 2014-06-13 06:52:58 +05:30
Akshay Vishnoi
5505131cc1 Move test for blank.rb under object 2014-06-11 22:53:05 +05:30
Yves Senn
47baab0c41 Merge pull request #15628 from akshay-vishnoi/test-cases
Add test cases for #in? and #presence_in
2014-06-11 17:25:36 +02:00
Akshay Vishnoi
f648195247 Add test cases for #in? and #presence_in 2014-06-11 06:50:18 +05:30
Adam Panzer
9010274627 fix error with long keys in ActiveSupport::Cache::FileStore 2014-06-10 10:53:48 -07:00
Rafael Mendonça França
3fe33a318f Fix bug that make HashWithIndifferentAccess work differently of Hash
Before HashWithIndifferentAccess were doing deep_dup of the inner hashes
when Hash doesn't do. Now both are behaving in the same way.
2014-06-09 18:30:05 -03:00
Aditya Kapoor
885ebda266 Add Missing Test Cases for the constantize 2014-06-07 23:58:38 +05:30
Matthew Draper
b2d070ddf6 Merge pull request #15421 from gchan/time_with_zone_precision
Fixed `ActiveSupport::TimeWithZone#-` so precision is not unnecessarily lost
2014-06-05 16:23:47 +09:30
Rafael Mendonça França
d516971155 Merge pull request #15447 from akshay-vishnoi/test-cases
Test `except!` in other cases too
2014-06-03 18:38:00 -03:00
Juanjo Bazán
60062cf39a Fix AS::NumberHelper results with rationals
:precision was incorrectly being applied to Rationals

before:
  ActiveSupport::NumberHelper.number_to_rounded Rational(10, 3), precision: 2
  => "3.3"
after:
  ActiveSupport::NumberHelper.number_to_rounded Rational(10, 3), precision: 2
  => "3.33"
2014-05-31 20:07:47 +02:00
Akshay Vishnoi
6976c7254d Test except! in other cases too 2014-05-31 22:40:00 +05:30