Thanks Mark. The problem was definitely in the wetwear.
I think the thing that threw me off was RubyMine was complaining about my
namespace.
Interestingly for me though both:
assert_equal("John",john.FirstName)
and
assert_equal("John",john.first_name)
work.
John(no)
On 22 February 2010 23:46, <[email protected]> wrote:
> Send Ironruby-core mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://rubyforge.org/mailman/listinfo/ironruby-core
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Ironruby-core digest..."
>
>
> Today's Topics:
>
> 1. Getting started with IronRuby and c# issues. (John Nolan)
> 2. Re: Getting started with IronRuby and c# issues. (Mark Ryall)
> 3. Code Review: Buffer7 (Tomas Matousek)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 20 Feb 2010 10:16:16 +0000
> From: John Nolan <[email protected]>
> To: [email protected]
> Subject: [Ironruby-core] Getting started with IronRuby and c# issues.
> Message-ID:
> <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi IronRuby mailing list,
>
> Inspired by a talk by Ben Hall on testing c# with Ruby I thought I'd give
> it
> a go but
> I'm frustratingly stuck at the first hurdle. I've emailed Ben but as I've
> not had an immediate response I thought I'd open it to you good people.
>
> Any way. I thought I'd start off simple and follow Dom Green's blog.
> domgreen.com/2010/02/07/pumping-iron-ruby-net-testing/
>
> He's set a class in c# with a simple property (here's mine)
>
> namespace IronRubyAndCSharp
> {
> public class Person
> {
> public string FirstName { get; set; }
>
> public Person(string name)
> {
> FirstName = name;
> }
> }
> }
>
> and tested it like so
>
> require "test/unit"
> require "../IronRuby/bin/debug/IronRubyAndCSharp.dll"
>
> class PersonTest < Test::Unit::TestCase
> include IronRubyAndCSharp
> def test_create_person_called_john
> john = Person.new("John")
> assert_not_nil(john)
> assert_equal("John",Person.FirstName)
> end
> end
>
> RubyMine(RM) has no problem with the require of the dll but it does have a
> problem recognising the namespace "IronRubyAndCSharp"
> and the Person class (squiggly lines ahoy).
>
> When I run the tests in RM I get
>
> NoMethodError: undefined method `FirstName' for
> IronRubyAndCSharp::Person:Class
> C:/Users/John/Documents/IronRuby/Tests/Person_test.rb:14:in
> `test_create_person_called_john'
> :0:in `send'
> :0:in `each'
> C:/Program Files (x86)/IronRuby
> 0.9.4.0/Lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
> :0:in `each'
> C:\Program Files (x86)\JetBrains\RubyMine
> 2.0.1\rb\testing\patch\testunit/test/unit/ui/testrunnermediator.rb:36:in
> `run_suite'
> testrunner.rb:213:in `start_mediator'
> C:\Program Files (x86)\JetBrains\RubyMine
> 2.0.1\rb\testing\patch\testunit/test/unit/ui/teamcity/testrunner.rb:191:in
> `start'
> testrunnerutilities.rb:28:in `run'
> C:/Program Files (x86)/IronRuby
> 0.9.4.0/Lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
> C:/Program Files (x86)/IronRuby
> 0.9.4.0/Lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
>
> Just in case RubyMine was at fault I dropped out to good old ir.exe
>
> C:\Users\John\Documents\IronRuby\Tests>ir Person_test.rb --name
> test_create_pers
> on_called_john
> Loaded suite Person_test
> Started
> E
> Finished in 0.041992 seconds.
>
> 1) Error:
> test_create_person_called_john(PersonTest):
> NoMethodError: undefined method `FirstName' for
> IronRubyAndCSharp::Person:Class
> Person_test.rb:14:in `test_create_person_called_john'
> :0:in `send'
> :0:in `each'
> :0:in `each'
> testrunner.rb:66:in `start_mediator'
> testrunnerutilities.rb:28:in `run'
>
> 1 tests, 1 assertions, 0 failures, 1 errors
>
> I've stuck my code up on github
> http://github.com/johnnonolan/IronRubyAndCSharp if you feel that was
> inclined.
>
> Any pointers, help or whatever much appreciated.
>
> PlzSendMeTehCodez
>
>
> John(no)
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://rubyforge.org/pipermail/ironruby-core/attachments/20100220/84e2a62f/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Sat, 20 Feb 2010 21:26:40 +1100
> From: Mark Ryall <[email protected]>
> To: [email protected]
> Subject: Re: [Ironruby-core] Getting started with IronRuby and c#
> issues.
> Message-ID:
> <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> ironruby will have 'rubified' the Person class's FirstName method to
> first_name and I think you mean to assert against the john instance of
> Person (rather than the Person class).
>
> Otherwise it looks pretty close.
>
> Try:
>
> require "test/unit"
> require "../IronRuby/bin/debug/IronRubyAndCSharp.dll"
>
> class PersonTest < Test::Unit::TestCase
> include IronRubyAndCSharp
> def test_create_person_called_john
> john = Person.new("John")
> assert_not_nil(john)
> assert_equal("John",john.first_name)
> end
> end
>
> On Sat, Feb 20, 2010 at 9:16 PM, John Nolan <[email protected]> wrote:
> > Hi IronRuby mailing list,
> > Inspired by a talk by Ben Hall on testing c# with Ruby I thought I'd give
> it
> > a go but
> > I'm frustratingly stuck at the first hurdle. I've emailed Ben but as I've
> > not had an immediate response I thought I'd open it to you good people.
> > Any way. I thought I'd start off simple and follow Dom Green's
> > blog. domgreen.com/2010/02/07/pumping-iron-ruby-net-testing/
> > He's set a class in c# with a simple property (here's mine)
> > namespace IronRubyAndCSharp
> > {
> > public class Person
> > {
> > public string FirstName { get; set; }
> > public Person(string name)
> > {
> > FirstName = name;
> > }
> > }
> > }
> > and tested it like so
> > require "test/unit"
> > require "../IronRuby/bin/debug/IronRubyAndCSharp.dll"
> > class PersonTest < Test::Unit::TestCase
> > include IronRubyAndCSharp
> > def test_create_person_called_john
> > john = Person.new("John")
> > assert_not_nil(john)
> > assert_equal("John",Person.FirstName)
> > end
> > end
> > RubyMine(RM) has no problem with the require of the dll but it does have
> a
> > problem recognising the namespace "IronRubyAndCSharp"
> > and the Person class (squiggly lines ahoy).
> > When I run the tests in RM I get
> > NoMethodError: undefined method `FirstName' for
> > IronRubyAndCSharp::Person:Class
> > C:/Users/John/Documents/IronRuby/Tests/Person_test.rb:14:in
> > `test_create_person_called_john'
> > :0:in `send'
> > :0:in `each'
> > C:/Program Files
> > (x86)/IronRuby
> 0.9.4.0/Lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
> > :0:in `each'
> > C:\Program Files (x86)\JetBrains\RubyMine
> > 2.0.1\rb\testing\patch\testunit/test/unit/ui/testrunnermediator.rb:36:in
> > `run_suite'
> > testrunner.rb:213:in `start_mediator'
> > C:\Program Files (x86)\JetBrains\RubyMine
> >
> 2.0.1\rb\testing\patch\testunit/test/unit/ui/teamcity/testrunner.rb:191:in
> > `start'
> > testrunnerutilities.rb:28:in `run'
> > C:/Program Files
> > (x86)/IronRuby 0.9.4.0/Lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
> > C:/Program Files
> > (x86)/IronRuby 0.9.4.0/Lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
> > Just in case RubyMine was at fault I dropped out to good old ir.exe
> > C:\Users\John\Documents\IronRuby\Tests>ir Person_test.rb --name
> > test_create_pers
> > on_called_john
> > Loaded suite Person_test
> > Started
> > E
> > Finished in 0.041992 seconds.
> > 1) Error:
> > test_create_person_called_john(PersonTest):
> > NoMethodError: undefined method `FirstName' for
> > IronRubyAndCSharp::Person:Class
> > Person_test.rb:14:in `test_create_person_called_john'
> > :0:in `send'
> > :0:in `each'
> > :0:in `each'
> > testrunner.rb:66:in `start_mediator'
> > testrunnerutilities.rb:28:in `run'
> > 1 tests, 1 assertions, 0 failures, 1 errors
> > I've stuck my code up on
> > github http://github.com/johnnonolan/IronRubyAndCSharp if you feel that
> was
> > inclined.
> > Any pointers, help or whatever much appreciated.
> > PlzSendMeTehCodez
> >
> > John(no)
> > _______________________________________________
> > Ironruby-core mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/ironruby-core
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://rubyforge.org/pipermail/ironruby-core/attachments/20100220/76149074/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Mon, 22 Feb 2010 23:46:23 +0000
> From: Tomas Matousek <[email protected]>
> To: IronRuby External Code Reviewers <[email protected]>
> Cc: "[email protected]" <[email protected]>
> Subject: [Ironruby-core] Code Review: Buffer7
> Message-ID:
> <
> 4b342496a3efeb48839e10bb4bf5964c3db7c...@tk5ex14mbxc122.redmond.corp.microsoft.com
> >
>
> Content-Type: text/plain; charset="us-ascii"
>
> tfpt review "/shelveset:Buffer7;REDMOND\tomat"
> Comment :
> Improves perf of IO#each_line.
> Fixes a few socket specs.
>
> Fixes:
> http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3314
> http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3231
>
> Tomas
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Buffer7.diff
> Type: application/octet-stream
> Size: 58628 bytes
> Desc: Buffer7.diff
> URL: <
> http://rubyforge.org/pipermail/ironruby-core/attachments/20100222/05730632/attachment.obj
> >
>
> ------------------------------
>
> _______________________________________________
> Ironruby-core mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
> End of Ironruby-core Digest, Vol 30, Issue 60
> *********************************************
>
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core