Skip to content

Commit 5e0f3ca

Browse files
committed
Change the expectation for predicate methods
Predicate methods typically return true or false, and should only exist for the uncountable and discrete, e.g. `use_transactional_fixtures?`, but not `max_formatted_output_length?`. This relates to changes made in rspec/rspec-core#2736
1 parent 71c4364 commit 5e0f3ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spec/rspec/rails/configuration_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@
2323
opts ||= {}
2424
default_value = opts[:default]
2525
alias_setting = opts[:alias_with]
26-
query_method = "#{accessor}?".to_sym
26+
query_method = accessor
27+
predicate_method = "#{accessor}?".to_sym
2728
command_method = "#{accessor}=".to_sym
2829

2930
specify "`##{query_method}` is `#{default_value.inspect}` by default" do
3031
expect(config.send(query_method)).to be(default_value)
3132
end
3233

34+
specify "`##{predicate_method}` is `#{!!default_value}` by default" do
35+
expect(config.send(predicate_method)).to be(!!default_value)
36+
end
37+
3338
describe "`##{command_method}`" do
3439
it "changes `#{query_method}` to the provided value" do
3540
expect {

0 commit comments

Comments
 (0)