Skip to content

Commit

Permalink
Merge pull request #238 from sue445/feature/check-duplicate-config
Browse files Browse the repository at this point in the history
Check config json on CI
  • Loading branch information
sue445 authored Dec 25, 2023
2 parents a6b28de + e97e4d0 commit 62a0ede
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 0 additions & 4 deletions docs/config/doorkeeper.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@
{
"id": "maebashirb",
"name": "Maebashi.rb"
},
{
"id": "rubytokai",
"name": "Ruby東海"
}
]
}
19 changes: 19 additions & 0 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
RSpec.describe "docs/config/" do
%w(connpass doorkeeper).each do |site|
describe "#{site}.json" do
subject(:groups) { JSON.parse(json_path.read)["groups"] }

let(:json_path) { config_dir.join("#{site}.json") }

it "id shouldn't be duplicated" do
ids = groups.map { |g| g["id"] }
expect(ids).to match_array(ids.uniq)
end

it "name shouldn't be duplicated" do
names = groups.map { |g| g["name"] }
expect(names).to match_array(names.uniq)
end
end
end
end
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ def app
def spec_dir
Pathname(__dir__)
end

def config_dir
spec_dir.join("..", "docs", "config")
end

0 comments on commit 62a0ede

Please sign in to comment.