Skip to content

Commit

Permalink
Add ensure_equal to initializer.rb.tt (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleolleolle authored Nov 24, 2023
1 parent e03e2d2 commit 58f1ee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 58f1ee8

Please sign in to comment.