-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
FeatureFreature requestFreature request
Description
Gemfile:
gem 'rspec', '= 3.0.0'
spec/described_class_spec.rb:
describe Array do
describe 'a string' do
it { expect(described_class).to eq(Array) }
end
describe :a_symbol do
it { expect(described_class).to eq(Array) }
end
describe Hash do
it { expect(described_class).to eq(Hash) }
end
describe Hash.new do
it { expect(described_class).to eq(Hash) }
end
end
This results in two errors--one on :a_symbol and one on Hash.new. IMO this behavior is non-intuitive. rspec/rspec-core#1114 seems to have made an exception for when the inner describe is an instance of String, which makes sense, because described_class.should be_a(Class)
. However, I argue that this should be consistent for all cases where the inner describe is not a Class. Either take its class, or skip it and move to the outer describe block, but don't return an instance.
Metadata
Metadata
Assignees
Labels
FeatureFreature requestFreature request