# Has someone tried to use Shoulda with IronRuby?

**URL:** <https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337>\
**Category:** IronRuby\
**Created:** [April 5, 2010, 10:15am UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337 "2010-04-05T10:15:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 5, 2010, 10:15am UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/1 "2010-04-05T10:15:20Z")

</div>

Hi there,

I’m trying to use Shoulda to test code (not in a Rails project) and I  
can’t  
get it to work. It seems like it doesn’t convert the should statements  
to  
test methods at all.  
Has anyone run into this before?

Thanks,  
Shay.

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 5, 2010, 3:30pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/2 "2010-04-05T15:30:16Z")

</div>

I get the same problem with test-spec. Both frameworks enhance  
Test::Unit and they both don’t work…

Thanks,  
Shay.

Shay F. wrote:

> Hi there,
> 
> I’m trying to use Shoulda to test code (not in a Rails project) and I  
> can’t  
> get it to work. It seems like it doesn’t convert the should statements  
> to  
> test methods at all.  
> Has anyone run into this before?
> 
> Thanks,  
> Shay.

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 5, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/3 "2010-04-05T16:27:34Z")

</div>

## Shoulda has a test suite. Have you run that to see what breaks?

Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 5, 2010, 4:33pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/4 "2010-04-05T16:33:25Z")

</div>

When I run it, it doesn’t find any test cases (even though I have  
one)…  
So nothing breaks because nothing is run.

## Thanks, Shay.

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 6, 2010, 8:55am UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/5 "2010-04-06T08:55:34Z")

</div>

This doesn’t work for me:

require ‘rubygems’  
require ‘shoulda’

## class MyTest \< Test::Unit::TestCase context “something” do should “be true” do assert true end end end

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 5, 2010, 6:01pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/6 "2010-04-05T18:01:13Z")

</div>

This what I did:  
cd %HOME%\dev  
ir -S gem install rake shoulda rails sqlite3-ironruby mocha --no-rdoc  
–no-ri  
git clone [GitHub - thoughtbot/shoulda: Makes tests easy on the fingers and the eyes](http://github.com/thoughtbot/shoulda.git)  
cd shoulda  
ir -S rake test

It appears to pass. Results are here: [should\_on\_ironruby · GitHub](http://gist.github.com/356509)

–  
Will G.  
[http://hotgazpacho.org/](http://hotgazpacho.org/)

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 6, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/7 "2010-04-06T15:37:08Z")

</div>

No, I don’t have MRI installed on this computer (I’m loyal to my  
IronRuby!  
🙂 )… If someone can try it, please do.

## Thanks, Shay.

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 6, 2010, 3:17pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/8 "2010-04-06T15:17:14Z")

</div>

I’ll have to try that later.

## Have you run the shoulda tests on MRI? Does it report a different number of Tests and Assertions?

Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 6, 2010, 5:12pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/9 "2010-04-06T17:12:33Z")

</div>

OK, I installed MRI and it worked. So it’s a problem with IronRuby…

* * *

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

---

<div class="post-metadata">

**Author:** ![shayfriedman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shayfriedman](https://www.ruby-forum.com/u/shayfriedman)\
**Post date:** [April 6, 2010, 6:16pm UTC](https://www.ruby-forum.com/t/has-someone-tried-to-use-shoulda-with-ironruby/186337/10 "2010-04-06T18:16:26Z")

</div>

Filed a bug:  
[http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4327](http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=4327).

Tomas

From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shay F.  
Sent: Tuesday, April 06, 2010 8:10 AM  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Ironruby-core] Has someone tried to use Shoulda with  
IronRuby?

OK, I installed MRI and it worked. So it’s a problem with IronRuby…

* * *

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

On Tue, Apr 6, 2010 at 3:36 PM, Shay F.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
No, I don’t have MRI installed on this computer (I’m loyal to my  
IronRuby! 🙂 )… If someone can try it, please do.

## Thanks, Shay.

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

On Tue, Apr 6, 2010 at 3:16 PM, Will G.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
I’ll have to try that later.

Have you run the shoulda tests on MRI? Does it report a different number  
of Tests and Assertions?

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Tue, Apr 6, 2010 at 2:54 AM, Shay F.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
This doesn’t work for me:

require ‘rubygems’  
require ‘shoulda’

## class MyTest \< Test::Unit::TestCase context “something” do should “be true” do assert true end end end

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

On Mon, Apr 5, 2010 at 6:00 PM, Will G.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
This what I did:  
cd %HOME%\dev  
ir -S gem install rake shoulda rails sqlite3-ironruby mocha --no-rdoc  
–no-ri  
git clone [http://github.com/thoughtbot/shoulda.git](http://github.com/thoughtbot/shoulda.git)  
cd shoulda  
ir -S rake test

It appears to pass. Results are here: [should\_on\_ironruby · GitHub](http://gist.github.com/356509)

–  
Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Mon, Apr 5, 2010 at 10:32 AM, Shay F.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
When I run it, it doesn’t find any test cases (even though I have  
one)…  
So nothing breaks because nothing is run.

## Thanks, Shay.

Shay F. | Microsoft Visual C#/IronRuby MVP | Author of IronRuby  
Unleashed | Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

## On Mon, Apr 5, 2010 at 4:26 PM, Will G. \<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote: Shoulda has a test suite. Have you run that to see what breaks?

Will G.

> **[hotgazpacho](http://hotgazpacho.org/)**

On Mon, Apr 5, 2010 at 9:30 AM, Shay F.  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
I get the same problem with test-spec. Both frameworks enhance  
Test::Unit and they both don’t work…

Thanks,  
Shay.

Shay F. wrote:

> Shay.  
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

* * *

Ironruby-core mailing list  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
