diff --git a/lib/swot.rb b/lib/swot.rb index 774441fb87..5f40d277b3 100644 --- a/lib/swot.rb +++ b/lib/swot.rb @@ -151,6 +151,7 @@ module Swot return false end end + alias_method :academic?, :is_academic? # Figure out the institution name based on the email address/domain. # @@ -162,6 +163,7 @@ module Swot domain = PublicSuffix.parse(text) name_from_academic_domain(domain) end + alias_method :school_name, :get_institution_name # Figure out if a domain name is a know academic institution. # diff --git a/test/test_swot.rb b/test/test_swot.rb index eb98d470d3..e2f46d47a7 100644 --- a/test/test_swot.rb +++ b/test/test_swot.rb @@ -47,4 +47,9 @@ class TestEmail < Test::Unit::TestCase should "returns name of valid institution" do assert_equal Swot::get_institution_name('lreilly@cs.strath.ac.uk'), "University of Strathclyde" end + + should "test aliased methods" do + assert_equal Swot::academic?('stanford.edu'), true + assert_equal Swot::school_name('lreilly@cs.strath.ac.uk'), "University of Strathclyde" + end end