Skip to content

Instantly share code, notes, and snippets.

@rsutphin
Created October 17, 2011 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsutphin/1293001 to your computer and use it in GitHub Desktop.
Save rsutphin/1293001 to your computer and use it in GitHub Desktop.
RSpec 2.7.0: Problem with full_description
describe 'A' do
describe '#foo' do
it 'is generally okay' do; end
describe 'subconcern' do
it 'has common behavior' do; end
describe 'case 1' do
it 'does the right thing' do; end
end
end
end
end
require 'rspec/core/formatters/base_formatter'
class DebugFormatter < ::RSpec::Core::Formatters::BaseFormatter
def start(*args)
super
STDOUT.puts "rspec-core #{RSpec::Core::Version::STRING}"
end
def example_started(example)
super
STDOUT.puts "Example: #{example.full_description.inspect}"
end
def example_group_started(example_group)
super
STDOUT.puts " Group: #{example_group.metadata[:example_group][:full_description].inspect}"
end
end
$ rspec _2.6.4_ -I. -f DebugFormatter a_spec.rb
rspec-core 2.6.4
Group: "A"
Group: "A#foo"
Example: "A#foo is generally okay"
Group: "A#foo subconcern"
Example: "A#foo subconcern has common behavior"
Group: "A#foo subconcern case 1"
Example: "A#foo subconcern case 1 does the right thing"
$ rspec _2.7.0_ -I. -f DebugFormatter a_spec.rb
rspec-core 2.7.0
Group: "A"
Group: "A#foo"
Example: "A#foo is generally okay"
Group: "A A#foo subconcern"
Example: "A A#foo subconcern has common behavior"
Group: "A A#foo A A#foo subconcern case 1"
Example: "A A#foo A A#foo subconcern case 1 does the right thing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment