Permalink
Browse files

get tests green

Irish is off by default? But this causes tests to fail... so turn it on by default.

add Hoe as a dependency in namecase.gemspec

mark testfile as UTF8

update to latest Hoe interface
  • Loading branch information...
1 parent b7b9c31 commit 2b2f03929afd6aeb7b81987c440a526dc8a418fa @mustmodify mustmodify committed Feb 27, 2014
Showing with 17 additions and 9 deletions.
  1. +2 −0 Gemfile
  2. +1 −0 Manifest.txt
  3. +1 −1 Rakefile
  4. +1 −1 lib/namecase.rb
  5. +2 −0 namecase.gemspec
  6. +10 −7 test/test_namecase.rb
View
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gemspec
View
@@ -1,3 +1,4 @@
+Gemfile
History.txt
LICENSE.txt
Manifest.txt
View
@@ -2,6 +2,6 @@ require 'rubygems'
require 'hoe'
require './lib/namecase.rb'
-Hoe.new('namecase', NameCase::VERSION) do |p|
+Hoe.spec('namecase') do |p|
p.developer('Aaron Patterson', 'aaronp@rubyforge.org')
end
View
@@ -3,7 +3,7 @@ module NameCase
# Returns a new +String+ with the contents properly namecased
def nc(options = {})
- options = { :lazy => true, :irish => false }.merge options
+ options = { :lazy => true, :irish => true }.merge options
# Skip if string is mixed case
if options[:lazy]
View
@@ -14,4 +14,6 @@ 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 "hoe"
end
View
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
$:.unshift File.join(File.dirname(__FILE__), "..", "test")
@@ -31,25 +33,26 @@ def setup
def test_namecase
@proper_names.each do |name|
- nc_name = NameCase.new(name)
- assert_equal(name, nc_name.downcase.nc)
- assert_equal(name, NameCase.nc(name))
+ assert_equal(name, NameCase(name.downcase))
+ n = name.dup
+ n.extend(NameCase)
+ assert_equal(name, n.nc)
assert_equal(name, NameCase(name))
end
end
def test_namecase_modify
@proper_names.each do |name|
- nc_name = NameCase.new(name)
- assert_equal(name, nc_name.downcase.nc!)
+ nc_name = NameCase!(name.downcase)
+ assert_equal(name, nc_name)
end
end
def test_namecase_multibyte
$KCODE = 'u'
proper_cased = 'Iñtërnâtiônàlizætiøn'
- nc_name = NameCase.new(proper_cased)
- assert_equal(proper_cased, nc_name.downcase.nc)
+ nc_name = NameCase(proper_cased.downcase)
+ assert_equal(proper_cased, nc_name)
end
end

0 comments on commit 2b2f039

Please sign in to comment.