Commit Graph

1982 Commits

Author SHA1 Message Date
Marat Kazbekov
0ebf45cf5d remove duplication in test 2013-07-18 20:48:19 +05:00
Andrew White
07a4c76a07 Only raise DelegationError if it's is the source of the exception
This fixes situations where nested NoMethodError exceptions are masked
by delegations. This would cause confusion especially where there was a
problem in the Rails booting process because of a delegation in the
routes reloading code.

Fixes #10559
2013-07-11 09:05:32 +01:00
Andrew White
4d733d2dd4 Add failing test for #9562
Rails 4.0.0 fails when trying to encode an ActiveSupport::TimeWithZone
that wraps a DateTime instance. This is fixed on master so add a test
to prevent regression.

(cherry picked from commit ad01b8da354268cebfae1519c28d19d75576ccb1)
2013-07-10 15:49:09 +01:00
Andrew White
c42260a325 Return local time for backwards compatibility 2013-07-09 15:50:14 +01:00
Andrew White
1b3873730b Retain UTC offset when using Time.at_with_coercion
The standard Ruby behavior for Time.at is to return the same type of
time when passing an instance of Time as a single argument. Since the
an ActiveSupport::TimeWithZone instance may be a different timezone than
the system timezone and DateTime just understands offsets the best we
can do is to return an instance of Time with the correct offset.

Fixes #11350.
2013-07-09 13:43:56 +01:00
Neer Friedman
484253515c Fix microsecond precision of Time#at_with_coercion
When Time.at_with_coercion (wraps Time.at) is called with a single
argument that "acts_like?(:time)" it is coerced to integer thus losing
it's microsecond percision.

This commits changes this to use `#to_f` to prevent the problem
2013-07-09 13:43:56 +01:00
Jade Tucker
8471fc0363 Explicitly test for true and false. 2013-07-07 18:59:32 -07:00
Marc Schütz
20c065594f Make HashWithIndifferentAccess#select always return the hash.
Hash#select! returns nil if the hash didn't change and thus behaves differently
from select, so it's return value can't be used as result for the latter.
2013-07-06 15:56:07 +02:00
Arun Agrawal
0cb0625c7f Fixed test broken by local_constant_names
depreciation removed
2013-07-03 19:56:49 +02:00
Arun Agrawal
36321d85e9 Remove deprecated String#encoding_aware?
core extensions (`core_ext/string/encoding`).
2013-07-03 19:50:19 +02:00
Vipul A M
ec5e03bf67 Remove deprecated Time#time_with_datetime_fallback, Time#utc_time
and `Time#local_time` in favour of `Time#utc` and `Time#local`
2013-07-03 18:52:53 +05:30
Carlos Antonio da Silva
01f0c3f308 Remove deprecated Hash#diff with no replacement.
If you're using it to compare hashes for the purpose of testing,
please use MiniTest's assert_equal instead.
2013-07-02 23:32:38 -03:00
Vipul A M
4bec1da79b Remove deprecated Date#to_time_in_current_zone 2013-07-02 11:22:19 +05:30
Carlos Antonio da Silva
f62fb985b6 Remove deprecated Proc#bind with no replacement. 2013-07-01 22:38:28 -03:00
Carlos Antonio da Silva
1c06bd17a9 Remove deprecated Array#uniq_by and Array#uniq_by!
Use native Array#uniq and Array#uniq! instead.
2013-07-01 22:33:42 -03:00
Carlos Antonio da Silva
cad3a13086 Remove deprecated AS::BasicObject, use AS::ProxyObject instead 2013-07-01 22:26:54 -03:00
Yves Senn
cfa35c55bb remove deprecated BufferedLogger. 2013-07-01 22:16:37 +02:00
Yves Senn
74ebc451c9 remove deprecated assert_present and assert_blank. 2013-07-01 22:06:26 +02:00
Carlos Antonio da Silva
bbbedeeb89 Move delegation error constant to inside Module 2013-06-26 20:17:58 -03:00
Yves Senn
3f50dd21c1 Merge pull request #10828 from southpolesteve/delegation_error_class
Create DelegationError class
2013-06-26 13:20:26 -07:00
Steve Faulkner
8139d727c5 Add DelegationError class. Rasied by delegation to a nil object 2013-06-26 15:12:54 -05:00
Mark J. Titorenko
a3678e45ec Fix BacktraceCleaner#noise for multiple silencers.
The previous implementation of BacktraceSilencer#noise did not
work correctly if more than one silencer was configured --
specifically, it would only return noise which was matched by all
silencers.

The new implementation is such that anything that has been matched by
silencers is removed from the backtrace using Array#- (array
difference), ie. we now return all elements within a backtrace that
have been matched by any silencer (and are thus removed by #silence).

Fixes #11030.
2013-06-20 19:54:32 +01:00
Paco Guzman
20bd16330c Rewind StringIO instances before be parsed again 2013-06-16 00:32:33 +02:00
Paco Guzman
e04d9538ea Use xml instead already parsed xml 2013-06-16 00:28:16 +02:00
Rafael Mendonça França
eabbfb2348 Merge pull request #10727 from pacoguzman/fix-xml-mini-tests
Fix XmlMini different backends tests
2013-06-15 13:06:49 -07:00
Rafael Mendonça França
78234fe605 Merge pull request #10740 from mrsimo/hash-with-indifferent-access-select
HashWithIndifferentAccess#select working as intended
2013-06-14 13:53:31 -07:00
Xavier Noria
85bb7d9af1 Merge pull request #10943 from killthekitten/10932_constantize_empty
Fix #10932. Treat "" and "::" as invalid on constantize
2013-06-14 02:19:25 -07:00
Nikolay Shebanov
7fd36f307a Fix #10932. Treat "" and "::" as invalid on constantize 2013-06-14 11:20:15 +04:00
Andrew White
a272d0cbe2 Add missing nsec test for 17f5d8e 2013-06-13 12:21:19 +01:00
Andrew White
17f5d8e062 Keep sub-second resolution when wrapping a DateTime value
Add `DateTime#usec` and `DateTime#nsec` so that `ActiveSupport::TimeWithZone`
keeps sub-second resolution when wrapping a `DateTime` value.

Fixes #10855
2013-06-13 12:01:12 +01:00
Vipul A M
48b6860b79 Drop extra variable from test 2013-06-12 11:18:35 +05:30
Andrew Kreiling
a548792aa0 Don't blindly call blame_file! on exceptions in ActiveSupport::Dependencies::Loadable
It is possible under some environments to receive an Exception that is
not extended with Blamable (e.g. JRuby).
ActiveSupport::Dependencies::Loadable#load_dependency blindly call
blame_file! on the exception which throws it's own NoMethodError
exception and hides the original Exception.

This commit fixes #9521
2013-06-09 18:20:10 -04:00
Andrew White
b7f9de27f0 Override Time.at to work with Time-like values
Time.at allows passing a single Time argument which is then converted
to an integer. The conversion code since 1.9.3r429 explicitly checks
for an instance of Time so we need to override it to allow DateTime
and ActiveSupport::TimeWithZone values.
2013-06-08 09:50:15 +01:00
Rafael Mendonça França
424fa92b35 Merge pull request #10784 from senny/10526_prevent_key_transformation
Prevent side effects in `Hash#with_indifferent_access`.
2013-06-03 16:46:59 -07:00
David Heinemeier Hansson
a6fe33d8a3 Allow Date to be compared with Time (like it was possible to compare Time with Date) 2013-06-03 16:47:48 +02:00
kennyj
6c2cbc6fff Remove active_support/testing/pending.rb was deprecated. 2013-06-01 21:23:19 +09:00
kennyj
6f3e01e8b7 Remove active_support/json/variable was deprecated. 2013-06-01 21:23:19 +09:00
Yves Senn
c44a929f49 Prevent side effects in Hash#with_indifferent_access. 2013-05-29 08:43:35 +02:00
Arun Agrawal
5eaa30e47c Running isolated tests
These stopped running don't know when. 
But these should be running now.
2013-05-28 19:59:55 +02:00
Carlos Antonio da Silva
c3890d38cb Merge pull request #10763 from senny/10758_to_sentence_with_blank_elements
test-case for `Array#to_sentence` with `blank?` items.
2013-05-26 13:51:49 -07:00
Yves Senn
27b8a99263 add test-case for `Array#to_sentence with blank items. 2013-05-26 18:47:23 +02:00
Vipul A M
d745d62616 Fix some typo in method names, variables 2013-05-26 16:27:05 +05:30
Albert Llop
921ec9b5c6 HashWithIndifferentAccess#select working as intended
Before this commit, #reject returned a HashWithIndifferentAccess,
whereas #select returned a Hash. Now #select also returns a
HashWithIndifferentAccess.
2013-05-23 15:26:00 +02:00
Paco Guzman
74c79104b9 Compare with the parsed result from REXML backend 2013-05-22 15:35:47 +02:00
Carl Lerche
e539228d08 Bug fix: Evented notification subscribers can handle published events 2013-05-17 16:27:23 -07:00
Rafael Mendonça França
8f2b1a12dc Merge pull request #10652 from md5/concern-multiple-included
Raise an error when multiple included blocks are defined for a Concern
2013-05-16 14:06:00 -07:00
Aaron Patterson
9fef7c8dc9 Merge pull request #10527 from zenspider/squishy_minitest5
Squishy minitest5
2013-05-16 13:41:54 -07:00
Mike Dillon
2d7a86e179 Raise when multiple included blocks are defined 2013-05-16 11:28:31 -07:00
Aaron Patterson
1012c3e969 remove deprecation notices 2013-05-15 09:40:58 -07:00
kennyj
f9c82f586c Fix HWIA#to_hash behavior with array of hashes. 2013-05-16 00:08:58 +09:00