Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ensure_equal to initializer.rb.tt #4

Merged
merged 3 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/generators/data_checks/templates/initializer.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ DataChecks.configure do

# ==> Configure checks
#
# Available checks are :ensure_no, :ensure_any, :ensure_more, and :ensure_less.
# Available checks are :ensure_no, :ensure_any, :ensure_more, :ensure_less,
# and :ensure_equal.
#
# ensure_no :users_without_emails do
# User.where(email: nil).count
Expand Down
8 changes: 8 additions & 0 deletions test/install_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def test_creates_initializer_file

assert_file("config/initializers/data_checks.rb") do |content|
assert_includes content, "DataChecks.configure do"
expected_dsl_methods = DataChecks::Config.new
.public_methods
.select { |dsl_method_name| dsl_method_name.to_s.start_with?("ensure_") }
.map(&:to_s)

expected_dsl_methods.each do |dsl_method_name|
assert_includes content, dsl_method_name
end
end
end
end