diff --git a/fixtures/small/rspec_its_actual.rb b/fixtures/small/rspec_its_actual.rb index c34b18cc..2b4cc143 100644 --- a/fixtures/small/rspec_its_actual.rb +++ b/fixtures/small/rspec_its_actual.rb @@ -39,6 +39,10 @@ opinion: "please don't name your DSL 'describe', but a little too late now I guess" do end +test "some really good test name" do + assert(true) +end + RSpec.describe "bees" do end diff --git a/fixtures/small/rspec_its_expected.rb b/fixtures/small/rspec_its_expected.rb index 658f0246..8e5c69a7 100644 --- a/fixtures/small/rspec_its_expected.rb +++ b/fixtures/small/rspec_its_expected.rb @@ -43,6 +43,10 @@ ) do end +test "some really good test name" do + assert(true) +end + RSpec.describe "bees" do end diff --git a/librubyfmt/src/format.rs b/librubyfmt/src/format.rs index 8cf9f7e4..57185ea2 100644 --- a/librubyfmt/src/format.rs +++ b/librubyfmt/src/format.rs @@ -696,7 +696,7 @@ pub fn args_has_single_def_expression(args: &ArgsAddStarOrExpressionListOrArgsFo } lazy_static! { - static ref RSPEC_METHODS: HashSet<&'static str> = vec!["it", "describe"].into_iter().collect(); + static ref TEST_METHODS: HashSet<&'static str> = vec!["it", "describe", "test"].into_iter().collect(); static ref GEMFILE_METHODS: HashSet<&'static str> = vec![ // Gemfile "gem", @@ -2762,7 +2762,7 @@ fn can_elide_parens_for_reserved_names(cc: &[CallChainElement]) -> bool { Ident(_, ident, _), ))) => { let ident = ident.as_str(); - RSPEC_METHODS.contains(ident) || GEMFILE_METHODS.contains(ident) + TEST_METHODS.contains(ident) || GEMFILE_METHODS.contains(ident) } _ => false, };