[MacRuby-devel] MiniTest and TestUnit implementations

2011-05-04 Thread anoiaque
Hi,

Why both minitest and testunit modules are so tied to output in the code ...
Why is there no class/instance method with which i can get result as an object 
(~ Minitest::Unit.run() => )

Why must i hack theses modules(even if its quite easy with ruby) to get result 
as an object i can work with , that is get (with Testunit) :
{}, "FAULT"=>{}}, @failures=[]>

Can you imagine , like it's done in ZenTest i gonna parse output with regexp to 
get it ... :(
:(

I've digged the source code (both minitest and testunit), but if i'm wrong and 
this way exists without hacking, tell me it ..

Thanks.



[email protected]




___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MiniTest and TestUnit implementations

2011-05-04 Thread Mark Rada
Hi,

Minitest doesn't have a really clean way of doing what you want, but it does 
have a simple way. If you look at minitest/pride:

https://github.com/seattlerb/minitest/blob/master/lib/minitest/pride.rb

It implements an alternative output format for minitest that you could copy and 
then change so it counts the number of tests.

Test::Unit in Ruby 1.9 is just a compatibility layer to minitest, so they are 
really the same thing for what you are asking about.

FWIW, rspec has proper custom formatters that support exactly what you have 
asked about.

HTH,

Mark Rada
[email protected]



On 2011-05-04, at 8:08 AM, anoiaque wrote:

> Hi,
> 
> Why both minitest and testunit modules are so tied to output in the code ...
> Why is there no class/instance method with which i can get result as an 
> object (~ Minitest::Unit.run() => 
> )
> 
> Why must i hack theses modules(even if its quite easy with ruby) to get 
> result as an object i can work with , that is get (with Testunit) :
>  @run_count=9, @channels={"CHANGED"=>{}, "FAULT"=>{}}, @failures=[]>
> 
> Can you imagine , like it's done in ZenTest i gonna parse output with regexp 
> to get it ... :(
> :(
> 
> I've digged the source code (both minitest and testunit), but if i'm wrong 
> and this way exists without hacking, tell me it ..
> 
> Thanks.
> 
> 
> 
> [email protected]
> 
> 
> 
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] "can't convert Class into String (TypeError)"

2011-05-04 Thread Nathaniel Talbott
I'm getting this error when trying to do a
performSelector:target:argument:order:modes: on an NSRunLoop, and as
far as I can tell I have all the arguments correct:

  https://gist.github.com/955260

You can reproduce by simply dropping that AppDelegate.rb in to a
freshly generated MacRuby project; I just tested it against the latest
from master.

Am I doing something stupid here, or is something broken underneath?


-- 
Nathaniel Talbott
<:((><
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] "can't convert Class into String (TypeError)"

2011-05-04 Thread Nathaniel Talbott
On Wed, May 4, 2011 at 10:31, Nathaniel Talbott  wrote:

> Am I doing something stupid here, or is something broken underneath?

To answer my own question, I was doing something stupid. Turns out the
argument to "modes:" should be an array of strings, not a single
string.

One thing I learned: if something's not working in MacRuby, it's
helpful to try it out in native ObjC since the error message there is
typically a lot more helpful.


-- 
Nathaniel Talbott
<:((><
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] "can't convert Class into String (TypeError)"

2011-05-04 Thread Pavlos Vinieratos
yep..
LLDB should be tweaked to understand MacRuby.
well.. sometime :)

also ->
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSRunLoop_Class/Reference/Reference.html
says here modes arg should be an array. I just saw the question and your
answer, or I would have responded faster.

On Wed, May 4, 2011 at 6:19 PM, Nathaniel Talbott wrote:

> On Wed, May 4, 2011 at 10:31, Nathaniel Talbott 
> wrote:
>
> > Am I doing something stupid here, or is something broken underneath?
>
> To answer my own question, I was doing something stupid. Turns out the
> argument to "modes:" should be an array of strings, not a single
> string.
>
> One thing I learned: if something's not working in MacRuby, it's
> helpful to try it out in native ObjC since the error message there is
> typically a lot more helpful.
>
>
> --
> Nathaniel Talbott
> <:((><
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>



-- 
Pavlos Vinieratos
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] hpricot and macruby?

2011-05-04 Thread macruby

With:
MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64]
and having done successfully:
macgem install hpricot ...

I get this when trying to use the actual gem:

dyld: lazy symbol binding failed: Symbol not found: _rb_enc_to_index
  Referenced from: 
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/hpricot-0.8.4/lib/fast_xs.bundle

  Expected in: flat namespace

is this a hpricot or macruby issue?
Any tips appreciated ... or do I give up, and attempt to convert this old 
script  to use: NSXMLDocument ?
(ruby 1.8.7 is core dumping, having its own problems, so I am hoping MacRuby 
is up to the task...)


-Daniel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] hpricot and macruby?

2011-05-04 Thread Andre Lewis
Daniel, I've had good lock with Nokogiri on MacRuby.
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] macruby rspec mock odd behavior

2011-05-04 Thread Gabriel Ayuso
Hi,

I'm having some strange issue with rspec mocks and hope someone can point out 
what I'm doing wrong.

I have a Objective C class with the method: 
buildRequestWithUrl:method:header:body:
I wrote an rspec mock for this class. I'm setting up an expectation as follows:

@requestBuilder.should_receive(:buildRequestWithUrl)
   .with("http://example.com";, method:"POST", header:nil, 
body:anything() )
   .and_return(nil)

When the class being tested calls the aforementioned method I get the following 
error:

RuntimeError:
   NSInvalidArgumentException: -[Mock 
buildRequestWithUrl:method:header:body:]: unrecognized selector sent to 
instance 0x200373ea0

I set the expectations for another method of the same class called 
:queryStringForDictionary
In this case the expectation and call do work.  

@requestBuilder.should_receive(:queryStringForDictionary).and_return( 
body )

In another project I'm calling the same class from ruby code and there the 
mocks and expectations do work properly. In this Objective C project they 
don't. 

Thanks in advance,
Gabriel Ayuso___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] hpricot and macruby?

2011-05-04 Thread Laurent Sansonetti
Hi Daniel,

I think the master branch is able to run hpricot, although I recommend using 
NSXMLDocument.

Laurent

On May 4, 2011, at 12:56 PM, [email protected] wrote:

> With:
> MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64]
> and having done successfully:
> macgem install hpricot ...
> 
> I get this when trying to use the actual gem:
> 
> dyld: lazy symbol binding failed: Symbol not found: _rb_enc_to_index
>  Referenced from: 
> /Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/hpricot-0.8.4/lib/fast_xs.bundle
>  Expected in: flat namespace
> 
> is this a hpricot or macruby issue?
> Any tips appreciated ... or do I give up, and attempt to convert this old 
> script  to use: NSXMLDocument ?
> (ruby 1.8.7 is core dumping, having its own problems, so I am hoping MacRuby 
> is up to the task...)
> 
> -Daniel
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel