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


Gary Insley
Gary Insley
14,133 Points

Problem when running bin/rspec for destroy_spec.rb tests (Deleting Todo Lists) - Creating a simple todo list application

I have been following along creating tests and running them, all my create tests and edit tests work, but when i have tried to run the Destroy Tests i am getting the following output to the console.

I have double checked all the code and do not believe there are any errors..... Could someone please help me to understand what the output means?


Console output after trying to run bin/rspec on destroy_spec.rb :

Garys-MacBook-Pro:odot Gary$ bin/rspec spec/features/todo_lists/destroy_spec.rb

/Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1065:in load': /Users/Gary/Desktop/Treehouse/odot/spec/features/todo_lists/destroy_spec.rb:17: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError) from /Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1065:inblock in load_spec_files' from /Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1065:in each' from /Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1065:inload_spec_files' from /Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/command_line.rb:18:in run' from /Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:103:inrun' from /Users/Gary/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:17:in `block in autorun'

2 Answers

We can say you have a syntax error on line 17 - an "unexpected end". This is likely to mean that you haven't closed something between lines 1 and 16 i.e. you're missing a required, additional 'end'. Check you've closed off all your blocks.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Please paste your whole spec code using Markdown.