Search code examples
ruby-on-railsrspecrspec-rails

Rails rspec :Treating `metadata[:execution_result]


problem with 'rspec_junit_formatter' when i doing

bundle exec rspec --format RspecJunitFormatter

i got errors like this,how to fix it?

home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/formatters/deprecation_formatter.rb:186:in `puts': Treating `metadata[:execution_result]` as a hash is deprecated. Use the attributes methods to access the data instead. Called from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec_junit_formatter-0.2.0/lib/rspec_junit_formatter/rspec3.rb:43:in `result_of'. (RSpec::Core::DeprecationError)
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/formatters/deprecation_formatter.rb:125:in `print_deprecation_message'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/formatters/deprecation_formatter.rb:36:in `deprecation'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/reporter.rb:137:in `block in notify'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/reporter.rb:136:in `each'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/reporter.rb:136:in `notify'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/reporter.rb:107:in `deprecation'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/warnings.rb:11:in `deprecate'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:455:in `issue_deprecation'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.4/lib/rspec/core/metadata.rb:319:in `[]'
    from /home/stasyan/.rvm/gems/ruby-2.1.1/gems/rspec_junit_formatter-

my Gemfile

    group :development, :test do
  gem 'capybara'
  gem 'database_cleaner'
  gem 'factory_girl_rails', '~> 4.0'
  gem 'faker', git: 'https://github.com/stympy/faker.git'
  gem 'pry'
  gem 'rspec-rails', '~>3.0.0'
  gem 'selenium-webdriver'
  gem 'spork'
  gem 'rspec_junit_formatter'
  gem 'rspec-core'
end

I will be glad to any proposals .. Thanks


Solution

  • this is a known problem, fixed three months ago...

    https://github.com/sj26/rspec_junit_formatter/commit/96f0115f7dabbea623f04b60dc23519683f39cfa

    You might want to install the gem as...

    gem 'rspec_junit_formatter', :git => 'https://github.com/sj26/rspec_junit_formatter.git'