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 Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Write Our First Tests

jorge martinez
jorge martinez
2,294 Points

Deprecation errors from rspec on windows 7

I dont understand what is this error...i did all the tutorial told me to... is the tutorial out of date ?

Deprecation Warnings:


The semantics of RSpec::Core::ExampleGroup.pending are changing in RSpec 3. In RSpec 2.x, it caused the example to be skipped. In RSpec 3, the example will still be run but is expected to fail, and will be marked as a failure (rather than as pending) if the example passes, just like how pending with a block from within an example already works.

To keep the same skip semantics, change pending to skip. Otherwise, if you want the new RSpec 3 behavior, you can safely ignore this warning and continue to upgrade to RSpec 3 without addressing it.

Called from C:/Users/User/Dropbox/stackademy/winter_2014_course/Jorge/Files/odot /spec/helpers/todo_lists_helper_spec.rb:14:in `block in <top (required)>'.



The semantics of RSpec::Core::ExampleGroup.pending are changing in RSpec 3. In RSpec 2.x, it caused the example to be skipped. In RSpec 3, the example will still be run but is expected to fail, and will be marked as a failure (rather than as pending) if the example passes, just like how pending with a block from within an example already works.

To keep the same skip semantics, change pending to skip. Otherwise, if you want the new RSpec 3 behavior, you can safely ignore this warning and continue to upgrade to RSpec 3 without addressing it.

Called from C:/Users/User/Dropbox/stackademy/winter_2014_course/Jorge/Files/odot /spec/models/todo_list_spec.rb:4:in `block in <top (required)>'.


stub_model is deprecated. Use the rspec-activemodel-mocks gem instead. Calle d from C:/Users/User/Dropbox/stackademy/winter_2014_course/Jorge/Files/odot/spec /views/todo_lists/new.html.erb_spec.rb:5:in `block (2 levels) in <top (required)

'. stub_model is deprecated. Use the rspec-activemodel-mocks gem instead. Calle d from C:/Users/User/Dropbox/stackademy/winter_2014_course/Jorge/Files/odot/spec /views/todo_lists/index.html.erb_spec.rb:6:in block (2 levels) in <top (require d)>'. stub_modelis deprecated. Use therspec-activemodel-mocksgem instead. Calle d from C:/Users/User/Dropbox/stackademy/winter_2014_course/Jorge/Files/odot/spec /views/todo_lists/index.html.erb_spec.rb:10:inblock (2 levels) in <top (requir ed)>'. Too many uses of deprecated 'stub_model'. Pass --deprecation-out or set con fig.deprecation_stream to a file for full output.

If you need more of the backtrace for any of these deprecations to identify where to make the necessary changes, you can configure config.raise_errors_for_deprecations!, and it will turn the deprecation warnings into errors, giving you the full backtrace.

7 deprecation warnings total

Finished in 2.6 seconds ←[33m30 examples, 0 failures, 2 pending←[0m

Randomized with seed 42569

thanks.

Jorge

2 Answers

jorge martinez
jorge martinez
2,294 Points

Thank you so much Brandon! ill read more on how to fix them, thanks!

Brandon Barrette
Brandon Barrette
20,485 Points

So you either have Rspec 3 or Rspec 2.99. These are to inform you of changes to Rspec for Rspec 3. The tutorials are written with Rspec 2.

The depreciation warnings are just that, warnings that code is being depreciated. You can either follow the directions in the depreciations (which will then cause the depreciations to go away), just ignore them, or downgrade to the version of Rspec used in the videos.

The idea here is that when you're ready to upgrade to Rspec 3, you would fix all these depreciation warnings first, so that after your upgrade, your tests will still pass. This way, you don't have to spend countless hours after an upgrade hunting down errors because of a change in Rspec versus errors that are actually embedded in your code.

Hope that helps! Happy coding! =)