mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Add Rake task to fetch ace_modes, and skip test if there's no internet
This commit is contained in:
		| @@ -371,7 +371,10 @@ class TestLanguage < Test::Unit::TestCase | ||||
|   end | ||||
|  | ||||
|   def test_all_languages_have_a_valid_ace_mode | ||||
|     ace_github_modes = JSON.parse `curl https://api.github.com/repos/ajaxorg/ace/contents/lib/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 = JSON.parse(File.read(ace_fixture_path)) | ||||
|     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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user