-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'rake/testtask' | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs << 'test' | ||
end | ||
|
||
desc "Run tests" | ||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'hola' | ||
puts Hola.hi(ARGV[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{hola} | ||
s.version = "0.0.0" | ||
s.name = "hola" | ||
s.version = "0.0.1" | ||
s.default_executable = "hola" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Nick Quaranto"] | ||
s.date = %q{2010-10-03} | ||
s.date = %q{2010-04-03} | ||
s.description = %q{A simple hello world gem} | ||
s.email = %q{[email protected]} | ||
s.files = ["lib/hola.rb"] | ||
s.files = ["Rakefile", "lib/hola.rb", "lib/hola/translator.rb", "bin/hola"] | ||
s.test_files = ["test/test_hola.rb"] | ||
s.homepage = %q{http:https://rubygems.org/gems/hola} | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.6.2} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
class Hola | ||
def self.hi(language) | ||
translator = Translator.new(language) | ||
puts translator.hi | ||
translator.hi | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'test/unit' | ||
require 'hola' | ||
|
||
class HolaTest < Test::Unit::TestCase | ||
def test_english_hello | ||
assert_equal "hello world", Hola.hi("english") | ||
end | ||
|
||
def test_any_hello | ||
assert_equal "hello world", Hola.hi("ruby") | ||
end | ||
|
||
def test_spanish_hello | ||
assert_equal "hola mundo", Hola.hi("spanish") | ||
end | ||
end |
a792e73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make my first gem, trying...
a792e73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hola_wirachmat