File: readme_spec.rb

package info (click to toggle)
ruby-hashdiff 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: ruby: 1,296; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 414 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require 'spec_helper'

describe 'README.md' do
  it 'has correct examples' do
    File.read('README.md').scan(/```ruby(.*?)```/m).flatten(1).each do |block|
      begin
        eval block # rubocop:disable Security/Eval
      rescue Exception => e # rubocop:disable Lint/RescueException
        raise "README.md code block:\n#{block}\n\nhas error:\n#{e}"
      end
    end
  end
end