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 trialFábio Tavares da Costa
11,985 PointsCoding around warnings
Not a question. I saw quite a few similar problems reported. So, I'm sharing my working version.
My specs: Treehouse VM, Ubuntu 12.04 LTS
treehouse:~/projects/odot (master *) $ pwd
/home/treehouse/projects/odot
treehouse:~/projects/odot (master *) $ uname --all
Linux treehouse 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:04:23 UTC 2014 i686 i686 i386 GNU/Linux
To work around the first set of deprecation errors exposed by...
treehouse:~/projects/odot (master *) $ bin/rspec spec/features/todo_lists/create_spec.rb
..
Finished in 0.44521 seconds
2 examples, 0 failures
Randomized with seed 1999
I passed the the following snippet at the very end of odot/spec/spec_helper.rb
. The log suggests a slightly different notation, so I used the following in a separated block:
RSpec.configure do |c|
# RSpec::Core::ExampleGroup#example is deprecated and will be removed in RSpec 3.
# [...] snippet to continue making this method available in RSpec 2.99 and RSpec 3:
c.expose_current_running_example_as :example
end
Everything works with a clean log after the addition.
Than, to code around the errors raised by...
bin/rspec spec/features/todo_lists/destroy_spec.rb # and
bin/rake spec
I used these steps.
- Installed the same version of shoulda-matchers form https://rubygems.org/gems/shoulda-matchers/versions/2.4.0
shoulda-matchers
will be used in the relationships stage
# terminal
gem install shoulda-matchers -v 2.4.0
# Genfile
gem 'shoulda-matchers', '~> 2.4.0'
# terminal
bundle update && bundle
- Installed the gem
rspec-activemodel-mocks
informed by the log.
# Genfile | group: development
rspec-activemodel-mocks
# spec_helper.rb
require 'rspec/rails' # here to function as a placeholder
require 'rspec/active_model/mocks'
# terminal
bundle
# grab the version and pass to Genfile
gem 'rspec-activemodel-mocks', '~>1.0.1'
Check
# terminal
bin/rspec spec/features/todo_lists/destroy_spec.rb && bin/rake spec
.
Finished in 0.28457 seconds
1 example, 0 failures
Randomized with seed 48119
...
PATHS
..*.........................*............
Pending:
TodoList add some examples to (or delete) /home/treehouse/projects/odot/spec/models/todo_list_spec.rb
# No reason given
# ./spec/models/todo_list_spec.rb:4
TodoListsHelper add some examples to (or delete) /home/treehouse/projects/odot/spec/helpers/todo_lists_helper_spec.rb
# No reason given
# ./spec/helpers/todo_lists_helper_spec.rb:14
Finished in 2.76 seconds
41 examples, 0 failures, 2 pending
Randomized with seed 7647
So far, so good. I am in the relationship stage. I will update the post if needed.
Fábio Tavares da Costa
11,985 PointsYou're welcome.
Gwyn Ellsworth
10,301 PointsGwyn Ellsworth
10,301 PointsThat RSpec deprecation error has been driving me crazy. Thanks for this!