Skip to content

Commit

Permalink
Fixing travis config and test setup
Browse files Browse the repository at this point in the history
- removing shoulda dependency. I feel bad now for doing this.
- Fixing development dependencies

(I probably won't publish a new gem version, API still unchanged)
  • Loading branch information
halfbyte committed Jun 19, 2014
1 parent aaaddfb commit 3b9d193
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
@@ -1,6 +1,5 @@
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.1
2 changes: 1 addition & 1 deletion afm.gemspec
Expand Up @@ -27,7 +27,7 @@ Gem::Specification.new do |s|
s.license = "MIT"
s.add_development_dependency "rake", "~> 10.3"
s.add_development_dependency "rdoc", "~> 4.1"
s.add_development_dependency "shoulda", "~> 3.5"
s.add_development_dependency "minitest", "~> 5.3"

end

4 changes: 0 additions & 4 deletions test/helper.rb
@@ -1,10 +1,6 @@
require 'rubygems'
require 'minitest/autorun'
require 'shoulda'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'afm'

class Minitest::Test
end
14 changes: 8 additions & 6 deletions test/test_afm.rb
Expand Up @@ -4,26 +4,28 @@ class TestAfm < Minitest::Test

def setup
@font = AFM::Font.new(File.join(File.dirname(__FILE__), 'fixtures', 'Vera.afm'))
end
end

should "set metadata" do
def test_should_set_metadata
assert_equal "BitstreamVeraSans-Roman", @font.metadata['FontName']
assert_equal "BitstreamVeraSans-Roman", @font['FontName']
end
should "set char_metrics" do

def test_should_set_char_metrics
assert_equal 400, @font.char_metrics['exclam'][:wx]
assert_equal [85, -131, 310, 758], @font.char_metrics['parenleft'][:boundingbox]
end
should "set char_metrics_by_code" do

def test_should_set_char_metrics_by_code
assert_equal 400, @font.char_metrics_by_code[33][:wx]
assert_equal [85, -131, 310, 758], @font.char_metrics_by_code[40][:boundingbox]
end

should "get char metrics by char" do
def test_should_get_char_metrics_by_char
assert_equal 400, @font.metrics_for("!")[:wx]
end

should "open font with alternative method" do
def test_open_font_with_alternative_method
assert !AFM::Font.from_file(File.join(File.dirname(__FILE__), 'fixtures', 'Vera.afm')).nil?
end

Expand Down

0 comments on commit 3b9d193

Please sign in to comment.