From 186136a8774912048e5bd90dde71e46eac32ff19 Mon Sep 17 00:00:00 2001 From: Andy Atkinson Date: Tue, 4 Feb 2014 22:32:04 -0500 Subject: [PATCH] Use minitest, specify the dependency in the gemspec Use https rubygems url in gemfile Add instructions to run tests to readme --- Gemfile | 2 +- README.md | 4 ++++ Rakefile | 8 ++++++++ language_list.gemspec | 1 + test/language_list_test.rb | 7 ++----- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index bdb395a..9c16eee 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source "https://rubygems.org" # Specify your gem's dependencies in language_list.gemspec gemspec diff --git a/README.md b/README.md index 2a8f9f5..c8d1d2e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ A list of languages based upon ISO-639-1 and ISO-639-3 with functions to retriev english.iso_639_3.inspect #=> "eng" english.common? #=> true +## Testing + + rake + ## Thanks Thanks goes to Steve Hardie for his work on creating a list of common languages (http://stevehardie.com/2009/10/list-of-common-languages/). diff --git a/Rakefile b/Rakefile index 14cfe0b..b93f00c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,2 +1,10 @@ require 'bundler' Bundler::GemHelper.install_tasks + +require 'rake/testtask' +Rake::TestTask.new do |t| + t.test_files = FileList['test/language_list_test.rb'] + t.verbose = true +end + +task :default => :test diff --git a/language_list.gemspec b/language_list.gemspec index 1c74370..ffec93f 100644 --- a/language_list.gemspec +++ b/language_list.gemspec @@ -18,4 +18,5 @@ Gem::Specification.new do |s| s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] + s.add_development_dependency 'minitest' end diff --git a/test/language_list_test.rb b/test/language_list_test.rb index 4fad366..45a55e3 100755 --- a/test/language_list_test.rb +++ b/test/language_list_test.rb @@ -1,10 +1,7 @@ -#!/usr/bin/env ruby - -$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))) -require 'test/unit' +require 'minitest/autorun' require 'language_list' -class LanguageListTest < Test::Unit::TestCase +class LanguageListTest < Minitest::Test def test_all_languages assert_equal 7707, LanguageList::ALL_LANGUAGES.length end