# Mac Leopard Tutorial Issue(s)

**URL:** <https://www.ruby-forum.com/t/mac-leopard-tutorial-issue-s/179380>\
**Category:** Rails\
**Created:** [November 23, 2009, 10:31pm UTC](https://www.ruby-forum.com/t/mac-leopard-tutorial-issue-s/179380 "2009-11-23T22:31:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [November 23, 2009, 10:31pm UTC](https://www.ruby-forum.com/t/mac-leopard-tutorial-issue-s/179380/1 "2009-11-23T22:31:39Z")

</div>

I am a Newb using Ruby 1.8.6 and Rails 2.3.4 on a Mac OS: 10.5.8

I have run into some issues with the Customizing Rails Applications on  
MAC OSX for Leopard. Hopefully this is a case of Stupid Newb tricks that  
are easily resolved so here goes.

I am following the Developing and Customizing Rails  
([http://developer.apple.com/Tools/developonrailsleopard.html](http://developer.apple.com/Tools/developonrailsleopard.html),  
[http://developer.apple.com/Tools/customizeonrailsleopard.html](http://developer.apple.com/Tools/customizeonrailsleopard.html)) tutorials  
and have run into 2 problems.

The first involves the “Writing Tests” section of Developing Rails. I  
added the following test method to the test/unit/event\_test.rb file:

* * *

require ‘test\_helper’

class EventTest \< ActiveSupport::TestCase  
test “the truth” do  
assert true  
end  
end

def test\_budget  
event = Event.new(:name =\> ‘Test Event’, :budget =\> 30.00)  
event.expenses.build(:amount =\> 10.00)  
event.expenses.build(:amount =\> 20.50)  
assert event.save

assert\_equal BigDecimal(“30.50”), event.total\_expenses  
assert event.budget\_exceeded?  
end

* * *

Then I ran test:units and instead of getting  
4 tests, 6 assertions, 0 failures, 0 errors  
I get  
3 tests, 3 assertions, 0 failures, 0 errors.

Should that be of any concern?

This leads to my second problem. In the “View Helpers” Section of  
“Customizing Rails…” tutorial I attempt to run Show on my Vendors and  
receive the following message:

* * *

NoMethodError in Events#show  
Showing app/views/events/\_expenses.erb where line #15 raised:  
Attempt to call private method  
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active\_record/attribute\_methods.rb:236:in  
`method\_missing’

* * *

What am I doing wrong?  
I can provide more detail if necessary. I look forward to your response.

Best Regards!

---

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [November 24, 2009, 4:24pm UTC](https://www.ruby-forum.com/t/mac-leopard-tutorial-issue-s/179380/2 "2009-11-24T16:24:13Z")

</div>

Steve Marz wrote:

> I am a Newb using Ruby 1.8.6 and Rails 2.3.4 on a Mac OS: 10.5.8
> 
> I have run into some issues with the Customizing Rails Applications on  
> MAC OSX for Leopard. Hopefully this is a case of Stupid Newb tricks that  
> are easily resolved so here goes.
> 
> I am following the Developing and Customizing Rails  
> ([http://developer.apple.com/Tools/developonrailsleopard.html](http://developer.apple.com/Tools/developonrailsleopard.html),  
> [http://developer.apple.com/Tools/customizeonrailsleopard.html](http://developer.apple.com/Tools/customizeonrailsleopard.html)) tutorials  
> and have run into 2 problems.

I’m not surprised. That tutorial is for Rails 2.0.2, not 2.3.4.

> The first involves the “Writing Tests” section of Developing Rails. I  
> added the following test method to the test/unit/event\_test.rb file:
> 
> * * *
> 
> require ‘test\_helper’
> 
> class EventTest \< ActiveSupport::TestCase  
> test “the truth” do  
> assert true  
> end  
> end
> 
> def test\_budget  
> event = Event.new(:name =\> ‘Test Event’, :budget =\> 30.00)  
> event.expenses.build(:amount =\> 10.00)  
> event.expenses.build(:amount =\> 20.50)  
> assert event.save
> 
> assert\_equal BigDecimal(“30.50”), event.total\_expenses  
> assert event.budget\_exceeded?  
> end
> 
> * * *
> 
> Then I ran test:units and instead of getting  
> 4 tests, 6 assertions, 0 failures, 0 errors  
> I get  
> 3 tests, 3 assertions, 0 failures, 0 errors.
> 
> Should that be of any concern?

I don’t know. I use RSpec for all my testing, since Test::Unit kinda  
sucks IMHO.

> This leads to my second problem. In the “View Helpers” Section of  
> “Customizing Rails…” tutorial I attempt to run Show on my Vendors and  
> receive the following message:
> 
> * * *
> 
> NoMethodError in Events#show  
> Showing app/views/events/\_expenses.erb where line #15 raised:  
> Attempt to call private method  
> /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active\_record/attribute\_methods.rb:236:in  
> `method\_missing’
> 
> * * *
> 
> What am I doing wrong?

What’s on that line?

Anyway, what you’re doing wrong is using an old tutorial. Check out  
[http://guides.rails.info](http://guides.rails.info) .

> I can provide more detail if necessary. I look forward to your response.
> 
> Best Regards!

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
