Skip to content

Commit

Permalink
test: fix the license test and actually run the test scripts (sendgri…
Browse files Browse the repository at this point in the history
  • Loading branch information
childish-sambino authored Jul 16, 2020
1 parent ecbbdd3 commit 2e5ef53
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ install:
gem install bundler:2.1.2; bundle install

test:
bundle exec rake spec
bundle exec rake

test-integ: test

Expand Down
2 changes: 1 addition & 1 deletion test/sendgrid/helpers/mail/test_mail.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative "../../../../lib/sendgrid/helpers/mail/mail"
require_relative "../../../../lib/sendgrid/client"
require_relative "../../../../lib/sendgrid/sendgrid"
include SendGrid
require "json"
require 'minitest/autorun'
Expand Down
57 changes: 19 additions & 38 deletions test/sendgrid/test_sendgrid-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2652,88 +2652,69 @@ def test_whitelabel_links__link_id__subuser_post
self.assert_equal('200', response.status_code)
end


def test_license_file_correct_year_range
if File.exist?('./LICENSE.md')
# get only the first line from the license txt file
year_range = File.open('./LICENSE.md', &:readline).gsub(/[^\d-]/, '')
self.assert_equal("#{Time.now.year}", year_range)
end
def test_license_file_year
# Read the third line from the license file
year = IO.readlines('./LICENSE.md')[2].gsub(/[^\d]/, '')
self.assert_equal("#{Time.now.year}", year)
end

def test_docker_exists
assert(File.file?('./Docker') || File.file?('./docker/Dockerfile'))
assert(File.file?('./Docker') || File.file?('./docker/Dockerfile'))
end

# def test_docker_compose_exists
# assert(File.file?('./docker-compose.yml') || File.file?('./docker/docker-compose.yml'))
# end

def test_env_sample_exists
assert(File.file?('./.env_sample'))
assert(File.file?('./.env_sample'))
end

def test_gitignore_exists
assert(File.file?('./.gitignore'))
assert(File.file?('./.gitignore'))
end

def test_travis_exists
assert(File.file?('./.travis.yml'))
assert(File.file?('./.travis.yml'))
end

def test_codeclimate_exists
assert(File.file?('./.codeclimate.yml'))
assert(File.file?('./.codeclimate.yml'))
end

def test_changelog_exists
assert(File.file?('./CHANGELOG.md'))
assert(File.file?('./CHANGELOG.md'))
end

def test_code_of_conduct_exists
assert(File.file?('./CODE_OF_CONDUCT.md'))
assert(File.file?('./CODE_OF_CONDUCT.md'))
end

def test_contributing_exists
assert(File.file?('./CONTRIBUTING.md'))
assert(File.file?('./CONTRIBUTING.md'))
end

def test_issue_template_exists
assert(File.file?('./ISSUE_TEMPLATE.md'))
assert(File.file?('./ISSUE_TEMPLATE.md'))
end

def test_license_exists
assert(File.file?('./LICENSE.md'))
assert(File.file?('./LICENSE.md'))
end

def test_pull_request_template_exists
assert(File.file?('./PULL_REQUEST_TEMPLATE.md'))
def test_pr_template_exists
assert(File.file?('./PULL_REQUEST_TEMPLATE.md'))
end

def test_readme_exists
assert(File.file?('./README.md'))
assert(File.file?('./README.md'))
end

def test_troubleshooting_exists
assert(File.file?('./TROUBLESHOOTING.md'))
assert(File.file?('./TROUBLESHOOTING.md'))
end

def test_usage_exists
assert(File.file?('./USAGE.md'))
end

def test_use_cases_domain_whitelabel_exists
assert(File.file?('./use-cases/domain-whitelabel.md'))
end

def test_use_cases_email_statistics_exists
assert(File.file?('./use-cases/email-statistics.md'))
assert(File.file?('./USAGE.md'))
end

def test_use_cases_readme_exists
assert(File.file?('./use-cases/README.md'))
end

def test_use_cases_transactional_templates_exists
assert(File.file?('./use-cases/transactional-templates.md'))
end
end

0 comments on commit 2e5ef53

Please sign in to comment.