# Assert2 0.3.2 and ActiveSupport 2.1.2

**URL:** <https://www.ruby-forum.com/t/assert2-0-3-2-and-activesupport-2-1-2/196843>\
**Category:** Rails\
**Created:** [November 14, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/assert2-0-3-2-and-activesupport-2-1-2/196843 "2008-11-14T16:07:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [November 14, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/assert2-0-3-2-and-activesupport-2-1-2/196843/1 "2008-11-14T16:07:59Z")

</div>

I’ve found a conflict between assert2 and ActiveSupport. Both define  
the  
method in\_groups\_of() with different signatures and semantics. It shows  
up in  
Ultrasphinx when I run my tests. I’ve reproduced it in the console, see  
below. Any suggests on how to force the desired in\_groups\_of() method?

TIA,  
Jeffrey

> script/console  
> Loading development environment (Rails 2.1.2)
> 
> > a = [1, 2, 3, 4]  
> > =\> [1, 2, 3, 4]
> 
> > a.in\_groups\_of(2)  
> > =\> [[1, 2], [3, 4]]
> 
> > require ‘assert2’  
> > =\> [“Assert\_2\_0”]
> 
> > a.in\_groups\_of(2)  
> > LocalJumpError: no block given  
> > from /usr/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > `each_slice' from /usr/lib/ruby/gems/1.8/gems/assert2-0.3.1/lib/ruby_reflector.rb:829:in`each’  
> > from  
> > /usr/lib/ruby/gems/1.8/gems/assert2-0.3.1/lib/ruby\_reflector.rb:829:in  
> > `each_slice' from /usr/lib/ruby/gems/1.8/gems/assert2-0.3.1/lib/ruby_reflector.rb:829:in`in\_groups\_of’  
> > from (irb):4

---

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [November 16, 2008, 12:37am UTC](https://www.ruby-forum.com/t/assert2-0-3-2-and-activesupport-2-1-2/196843/2 "2008-11-16T00:37:02Z")

</div>

I find it hard to beleive that I am the only one using both UltraSphinx  
and  
assert{2.0}. To make the question more general, how do I in Ruby  
disambiguate  
method calls? I.e., given two methods with identical names, say meth,  
in different  
namespace, e.g., NS1 and NS2 how do a force a call to one of them?  
Using the  
example below, I’d like to call

a.NS1::in\_groups\_of(2) or maybe a.NS1.in\_groups\_of(2)

TIA,  
Jeffrey

Quoting Jeffrey L. Taylor [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [November 16, 2008, 1:01am UTC](https://www.ruby-forum.com/t/assert2-0-3-2-and-activesupport-2-1-2/196843/3 "2008-11-16T01:01:01Z")

</div>

Quoting Jeffrey L. Taylor [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Loading development environment (Rails 2.1.2)  
> from /usr/lib/ruby/gems/1.8/gems/assert2-0.3.1/lib/ruby\_reflector.rb:829:in `each_slice' from /usr/lib/ruby/gems/1.8/gems/assert2-0.3.1/lib/ruby_reflector.rb:829:in `in\_groups\_of’  
> from (irb):4
> 
> > > quit

My solution is to delete the in\_groups\_of method in the assert{2.0}. It  
appears to be just a special case of the code in ActiveSupport.

Jeffrey
