File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 11require 'spec_helper'
22require 'gem_advisory_example'
33require 'ruby_advisory_example'
4+ require 'check_indents'
45
56describe "gems" do
67 Dir . glob ( File . join ( ROOT , 'gems/*/*' ) ) do |path |
Original file line number Diff line number Diff line change 1+ require "yaml"
2+
3+ RSpec . describe "Check Advisory indentation formatting" do
4+ Dir . glob ( "gems/**/**/*.yml" ) . each do |file |
5+ context file do
6+ let ( :lines ) { File . readlines ( file ) }
7+
8+ it "does not contain lines starting with '- '" do
9+ bad = lines . select { |l | l . match? ( /^- / ) }
10+ expect ( bad ) . to be_empty , "Found lines starting with '- ':\n #{ bad . join } "
11+ end
12+
13+ it "does not contain lines starting with ' - http'" do
14+ bad = lines . select { |l | l . match? ( /^ - http/ ) }
15+ expect ( bad ) . to be_empty , "Found lines starting with ' - http':\n #{ bad . join } "
16+ end
17+ end
18+ end
19+
20+ Dir . glob ( "rubies/**/**/*.yml" ) . each do |file |
21+ context file do
22+ let ( :lines ) { File . readlines ( file ) }
23+
24+ it "does not contain lines starting with '- '" do
25+ bad = lines . select { |l | l . match? ( /^- / ) }
26+ expect ( bad ) . to be_empty , "Found lines starting with '- ':\n #{ bad . join } "
27+ end
28+
29+ it "does not contain lines starting with ' - http'" do
30+ bad = lines . select { |l | l . match? ( /^ - http/ ) }
31+ expect ( bad ) . to be_empty , "Found lines starting with ' - http':\n #{ bad . join } "
32+ end
33+ end
34+ end
35+ end
You can’t perform that action at this time.
0 commit comments