24 Dec '16, 12am

@josh_cheek @mcmire It was a new feature in RSpec 3.4:

RSpec finds the failure code snippet by looking through the exception stack trace for an appropriate frame. We could just use the top stack frame but that's generally not what you want: when you have an expectation failure, the top frame refers to a link in RSpec where the RSpec::Expectations::ExpectationNotMetError was raised, and you want to see the snippet from your expect call site rather than seeing a snippet of RSpec's code. Before RSpec 3.4, our solution for this was fairly naive: we just looked for the first stack frame from the spec containing your current running example file. In some situations this would display the wrong snippet (such as when your example called a helper method defined in a spec/support file where the real failure occurred). In others it didn't find anything and we wound up displaying Unable to find matching line from backtrace

Full article: http://rspec.info/blog/2015/11/rspec-3-4-has-been-release...

Tweets

Gem for testing APIs with rspec

rubyflow.com 18 Dec '16, 12pm

× The Ruby and Rails community linklog Made a library? Written a blog post? Found a useful tutorial? Share it with the Rub...

Learn live! "ConstructionProject / Rails with R...

livecoding.tv 17 Dec '16, 6pm

Rails 4.x / Mysql2 / Rbenv (local) Html Slim Markup - JQuery - Bootstrap - Ajax unobtrusive Testing : Guard Rspec / Capyba...