Permalink
Browse files

updated the test suite

  • Loading branch information...
1 parent 28effdd commit 3815c6873f8affe96076dc476b87d105b06f7172 @georgeG committed Jan 15, 2011
Showing with 9 additions and 10 deletions.
  1. +9 −8 test/aa_test.rb
  2. +0 −2 test/test_bio-isoelectric_point.rb
View
17 test/aa_test.rb
@@ -1,5 +1,6 @@
-require 'test_helper'
+ #require 'helper'
+require File.join(File.expand_path(File.dirname(__FILE__)),'helper')
# include Bio::Sequence
class AATest < Test::Unit::TestCase
@@ -28,7 +29,7 @@ class AATest < Test::Unit::TestCase
should 'calculate iep' do
places = 2
@known.each do |sequence, expected|
- actual = Bio::Sequence::AA.new(sequence).calculate_iep('dtaselect', places)
+ actual = Bio::Sequence::AA.new(sequence).isoelectric_point('dtaselect', places)
assert_equal expected.round_to_places(places), actual, "Expected the iep to be #{expected} but was #{actual} for #{sequence}"
end
end
@@ -59,10 +60,10 @@ class AATest < Test::Unit::TestCase
end
should "calculates the isolectric point to 0 places" do
- assert_equal 11, @sequence.calculate_iep('dtaselect', 0)
+ assert_equal 11, @sequence.isoelectric_point('dtaselect', 0)
end
should "calculates the isolectric pointto 3 places" do
- assert_equal 10.603, @sequence.calculate_iep('dtaselect', 3)
+ assert_equal 10.603, @sequence.isoelectric_point('dtaselect', 3)
end
context 'use a custom pka set' do
@@ -79,22 +80,22 @@ class AATest < Test::Unit::TestCase
}
end
should 'accept a custom pka set and use it for calculation' do
- assert_equal 10.106, @sequence.calculate_iep(@custom, 3)
+ assert_equal 10.106, @sequence.isoelectric_point(@custom, 3)
end
should 'raise when no result can be found due to a invalid set' do
@custom['K'] = 20
assert_raises RuntimeError do
- @sequence.calculate_iep(@custom, 3)
+ @sequence.isoelectric_point(@custom, 3)
end
end
end
context 'use another pka set' do
should 'work with all provided sets without raising' do
Bio::Sequence::PkaData::PKAS.keys.each do |key|
- @sequence.calculate_iep(key, 3, 25)
+ @sequence.isoelectric_point(key, 3, 25)
end
end
end
end
-end
+end
View
2 test/test_bio-isoelectric_point.rb
@@ -1,7 +1,5 @@
require 'helper'
class TestBioIsoelectricPoint < Test::Unit::TestCase
- should "create a real test" do
- end
end

0 comments on commit 3815c68

Please sign in to comment.