Skip to content

Commit

Permalink
Make CodeRay.supported_languages tests Ruby 1.8 compatible.
Browse files Browse the repository at this point in the history
Ruby 1.8 (using Test::Unit) doesn't provide:
* the assert_includes method;
* the refute_includes method;
* the refute method.
  • Loading branch information
MischaTheEvil committed Jun 16, 2017
1 parent f3b9038 commit b75ca18
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/functional/basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,32 +161,32 @@ def test_supported_languages_should_return_array_of_symbols
end

def test_supported_languages_should_include_languages
assert_includes CodeRay.supported_languages, :ruby
assert CodeRay.supported_languages.include?(:ruby)
end

def test_supported_languages_without_arguments_should_include_aliases_and_exclude_internals
assert_includes CodeRay.supported_languages, :javascript
refute_includes CodeRay.supported_languages, :debug
assert CodeRay.supported_languages.include?(:javascript)
assert !CodeRay.supported_languages.include?(:debug)
end

def test_supported_languages_with_arguments_should_include_aliases_and_exclude_internals
assert_includes CodeRay.supported_languages(true, false), :javascript
refute_includes CodeRay.supported_languages(true, false), :debug
assert CodeRay.supported_languages(true, false).include?(:javascript)
assert !CodeRay.supported_languages(true, false).include?(:debug)
end

def test_supported_languages_with_arguments_should_exclude_aliases_and_include_internals
refute_includes CodeRay.supported_languages(false, true), :javascript
assert_includes CodeRay.supported_languages(false, true), :debug
assert !CodeRay.supported_languages(false, true).include?(:javascript)
assert CodeRay.supported_languages(false, true).include?(:debug)
end

def test_supported_languages_with_arguments_should_include_aliases_and_internals
assert_includes CodeRay.supported_languages(true, true), :javascript
assert_includes CodeRay.supported_languages(true, true), :debug
assert CodeRay.supported_languages(true, true).include?(:javascript)
assert CodeRay.supported_languages(true, true).include?(:debug)
end

def test_supported_languages_with_arguments_should_exclude_aliases_and_internals
refute_includes CodeRay.supported_languages(false, false), :javascript
refute_includes CodeRay.supported_languages(false, false), :debug
assert !CodeRay.supported_languages(false, false).include?(:javascript)
assert !CodeRay.supported_languages(false, false).include?(:debug)
end

def test_token_kinds
Expand Down

0 comments on commit b75ca18

Please sign in to comment.