diff --git a/spec/rspec/core/example_group_spec.rb b/spec/rspec/core/example_group_spec.rb index 4c63d2d12..828f57893 100644 --- a/spec/rspec/core/example_group_spec.rb +++ b/spec/rspec/core/example_group_spec.rb @@ -637,6 +637,26 @@ def define_and_run_group(define_outer_example = false) group = RSpec.describe(Object, "my desc") { } expect(group.description).to eq(group.metadata[:description]) end + + it "does not output deprecation warning when description is a string" do + expect_no_deprecation + RSpec.describe.it('hoge') + end + + it "does not output deprecation warning when description is nil" do + expect_no_deprecation + RSpec.describe.it + end + + it "outputs deprecation warining when description is a symbol" do + expect_deprecation_with_call_site(__FILE__, __LINE__ + 1, /Symbol object `:symbol` as example doc string/) + RSpec.describe.it(:symbol) + end + + it "outputs deprication warning when description is a hash" do + expect_deprecation_with_call_site(__FILE__, __LINE__ + 1, /Hash object `{"foo"=>"bar"}` as example doc string/) + RSpec.describe.it({ "foo" => "bar" }) + end end describe '#metadata' do