Re: Ruby class

69 views
Skip to first unread message

Sarah Allen

unread,
Nov 1, 2010, 8:28:55 AM11/1/10
to Robert Fletcher, test-firs...@googlegroups.com
Hi Robert,

I'm cc'ing Alex who has been working on the Test First website. There's a script that pulls out just the specs in learn_ruby and posts them as a zip, might be worthwhile to create a numbered list of 'em.

I've been doing that manually here:
http://github.com/blazingcloud/ruby_lessons

I've also got a set of slides that I'm happy to share with you.

You should also join the test-first-teaching group here; http://groups.google.com/group/test-first-teaching

This would be very cool!

Sarah

On Oct 31, 2010, at 6:30 PM, Robert Fletcher wrote:

> Hey Sarah,
>
> So I've been talking to some people at Noisebridge and there seems to be a reasonable level of interest in learning Ruby, so I thought I would start offering a free weekly class there. Your Test-First Teaching material seems to be a great place to start, but I kind of wanted to change things around a little bit. I was thinking of forking it so that I can cut it down to just the Ruby specs and restructure the files, but I wanted to get your thoughts on it first. Here's what I'm thinking of doing:
>
> -Keep only the stuff in the learn_ruby folder
> -Delete all solutions and help files
> -Delete any rails projects
> -Number the directories for an appropriate ordering
>
> And then depending on how the class goes I could see having the students add more specs and higher level lessons, maybe introducing some of the other tools later on, such as rails or other gems like DataMapper and Cucumber. What do you think?
>
> -Robert

Alex Chaffee

unread,
Nov 1, 2010, 12:59:12 PM11/1/10
to test-firs...@googlegroups.com, Robert Fletcher
> I'm cc'ing Alex who has been working on the Test First website.  There's a script that pulls out just the specs in learn_ruby and posts them as a zip, might be worthwhile to create a numbered list of 'em.

The zip file is optional. At Liah's request, I want to make the main mode of use to generate a new tree full of only tests (no solutions) and then automatically push it to a separate git repo. I haven't worked on it for a couple months so I'm a bit unclear on the current status but it's definitely well on the way to that goal.

I think running the solutions with the verbose rspec mode gives you the list of tests. Just run "rake" from root level. The failures are because there's missing or broken solutions. E.g.:

Running learn_ruby/hello/hello_spec.rb with solution
Hello
 says hello
Finished in 0.000536 seconds
1 example, 0 failures
learn_ruby/hello passed
Running learn_ruby/in_words/in_words_spec.rb with solution
Fixnum
 reads 0 to 9
 reads 10 to 12
 reads teens
 reads tens
 reads various other numbers less than 100
 reads hundreds
 reads thousands
 reads millions
 reads billions (FAILED - 1)
Go check in_words/in_words_spec.rb:74:in `block in <top (required)>'
learn_ruby/in_words passed
Running learn_ruby/orange_tree/orange_tree_spec.rb with solution
OrangeTree
 should increment the tree's age with each passing year
 should die after 80 years
 should produce fruit after 2 years
 should increase fruit production by 5 pieces each year after maturity
 should count the number of oranges eaten this year
 should not let you pick fruit that isn't there
Finished in 0.00094 seconds


> I've been doing that manually here:
> http://github.com/blazingcloud/ruby_lessons

Ordering is an important feature request. I've been trying to take input from Sarah and Liah and take their manual processes and move them in to the rake task, but they keep pushing the envelope and solving more problems and then not telling me about it until later! Curse their motivation and resourcefulness! :-)



> On Oct 31, 2010, at 6:30 PM, Robert Fletcher wrote:
>
>> Hey Sarah,
>>
>> So I've been talking to some people at Noisebridge and there seems to be a reasonable level of interest in learning Ruby, so I thought I would start offering a free weekly class there.

Yay!

>  Your Test-First Teaching material seems to be a great place to start, but I kind of wanted to change things around a little bit.  I was thinking of forking it so that I can cut it down to just the Ruby specs and restructure the files, but I wanted to get your thoughts on it first.

I'd rather you work with me to improve the infrastructure rather than forking and going crazy (not that there's anything wrong with that per se). There are reasons, some obvious, some veiled, some certainly mistaken, around the current system. I'd like to make sure we're on the same page before writing the next chapter (so to speak).

In particular, most or all of what you want is already in there but poorly documented (yet).


>>  Here's what I'm thinking of doing:
>>
>> -Keep only the stuff in the learn_ruby folder
>> -Delete all solutions and help files

I think this is pretty much done already code-wise, and if not, it's the plan. Let me get back into the code today and I'll give you a status report.

>> -Delete any rails projects

There aren't any rails projects in test-first-teaching are there?

>> -Number the directories for an appropriate ordering

Good idea but mere directory numbering isn't scalable since it doesn't provide for easy renumbering or inserting later. Another idea is a YAML file at root level.


>> And then depending on how the class goes I could see having the students add more specs and higher level lessons, maybe introducing some of the other tools later on, such as rails or other gems like DataMapper and Cucumber.  What do you think?

Love it. I want more lessons in "learn_ruby" and more top-level modules like, say, "learn_rails" or Wolf's TDD Rails stuff if and when he open sources it. Separate test-first modules would illuminate the top-level design of the testfirst.org site. It's not meant to be learn_ruby only; quite the contrary -- there's also learn_java and room for many more. A bit of graphic and info design would make this a lot clearer, I think.

Robert, let's chat! On GChat or skype or something?

--

Alex Chaffee - al...@cohuman.com - http://alexch.github.com
Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com


Reply all
Reply to author
Forward
0 new messages