Skip to content

Commit

Permalink
Update Ace mode paths for tests (#6002)
Browse files Browse the repository at this point in the history
* Update ace mode path

The directory structure was changed in ajaxorg/ace#4851

* Grab both locations
  • Loading branch information
lildude authored Aug 13, 2022
1 parent 249bbd1 commit 1f65799
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ task :fetch_ace_modes do
File.delete(ACE_FIXTURE_PATH) if File.exist?(ACE_FIXTURE_PATH)

begin
ace_github_modes = URI.open("https://api.github.com/repos/ajaxorg/ace/contents/lib/ace/mode").read
File.write(ACE_FIXTURE_PATH, ace_github_modes)
ace_github_modes_lib = URI.open("https://api.github.com/repos/ajaxorg/ace/contents/lib/ace/mode").read
ace_github_modes_src = URI.open("https://api.github.com/repos/ajaxorg/ace/contents/src/mode").read
File.write(ACE_FIXTURE_PATH, "[#{ace_github_modes_lib},#{ace_github_modes_src}]")
rescue OpenURI::HTTPError, SocketError
# no internet? no problem.
end
Expand Down
3 changes: 2 additions & 1 deletion test/test_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ def test_all_languages_have_a_valid_ace_mode
ace_fixture_path = File.join('test', 'fixtures', 'ace_modes.json')
skip("No ace_modes.json file") unless File.exist?(ace_fixture_path)

ace_github_modes = Yajl.load(File.read(ace_fixture_path))
ace_modes = Yajl.load(File.read(ace_fixture_path))
ace_github_modes = ace_modes[0].concat(ace_modes[1])
existing_ace_modes = ace_github_modes.map do |ace_github_mode|
File.basename(ace_github_mode["name"], ".js") if ace_github_mode["name"] !~ /_highlight_rules|_test|_worker/
end.compact.uniq.sort.map(&:downcase)
Expand Down

0 comments on commit 1f65799

Please # to comment.