Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

Rspec running program instead of tests

Hey everyone - silly question. I've been up working on this all weekend and copied a bunch of things from my other files into one place.

When I run rspec, it's currently running my program instead of running the tests.

Could you please take a look and let me know if you can see what's up? https://github.com/summerspirit/arcadian-spork

Thanks!

1 Answer

Jesse James
Jesse James
6,079 Points

Naomi-

My first thoughts would be that in some of your tests (at least the noughtscrosses_spec) you're calling Game.play in the test which is going to run the actual game. Since play is in reality just calling out to other methods in a particular order, a test checking for result to not be nil from running Game.play probably isn't that helpful. Instead you may want to use a gem like Capybara for integration testing down the road.