Skip to content
Merged
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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,28 @@ class ErbImplementationTest < ActiveSupport::TestCase
end
end

```
If you're using RSpec you can add the following code to `spec/better_html_spec.rb`

```ruby
# frozen_string_literal: true

require "rails_helper"

RSpec.describe "BetterHtml" do
it "does assert that all .html.erb templates are parseable" do
erb_glob = Rails.root.join(
"app", "views", "**", "{*.htm,*.html,*.htm.erb,*.html.erb,*.html+*.erb}"
)

Dir[erb_glob].each do |filename|
data = File.read(filename)
expect { BetterHtml::BetterErb::ErubiImplementation.new(data).validate! }.not_to raise_exception
end
end
end


```

## Working with the ERB parser
Expand Down