Permalink
Browse files

Fix bug and bump to 0.2.3

  • Loading branch information...
1 parent 546bd3f commit 540002bff0903aaf4751353ca77d2af1ec112709 @dcadenas dcadenas committed Mar 28, 2012
Showing with 17 additions and 5 deletions.
  1. +7 −3 Rakefile
  2. +1 −1 VERSION
  3. +1 −1 ext/rankable_graph/rankable_graph.c
  4. +8 −0 spec/rankable_graph_spec.rb
View
@@ -10,13 +10,16 @@ spec = Gem::Specification.new do |s|
s.add_development_dependency "rspec", ">= 1.2.9"
s.requirements << 'glib2, v2.22.2 or greater'
s.version = version
- s.files = `git ls-files`.split
+ s.files = `git ls-files`.split("\n")
end
-require 'rake/extensiontask'
-Rake::PackageTask.new("rankable_graph", version) do |pkg|
+require 'rubygems/package_task'
+Gem::PackageTask.new(spec) do |pkg|
+ pkg.need_zip = false
+ pkg.need_tar = false
end
+require 'rake/extensiontask'
Rake::ExtensionTask.new('rankable_graph', spec)
require 'rspec/core/rake_task'
@@ -26,3 +29,4 @@ end
task :spec => :compile
task :default => :spec
+
View
@@ -1 +1 @@
-0.2.2
+0.2.3
@@ -160,7 +160,7 @@ static gfloat* step(gfloat s, gfloat t_over_size, gfloat *p, RNStruct *rn, GArra
}
static VALUE rank(VALUE self, VALUE s, VALUE tolerance){
- if(rb_block_given_p() == Qtrue){
+ if(rb_block_given_p()){
RNStruct* rn;
Data_Get_Struct(self, RNStruct, rn);
@@ -12,6 +12,14 @@ def assert_rank(rankable_graph, expected_rank)
end
describe RankableGraph do
+ it "should enter the block" do
+ rankable_graph = RankableGraph.new
+ entered = false
+ rankable_graph.link(0, 1)
+ rankable_graph.rank(0.85, 0.0001){|_, _| entered = true }
+ entered.should be_true
+ end
+
it "should be possible to recalculate the ranks after a new link is added" do
rankable_graph = RankableGraph.new
rankable_graph.link(0, 1)

0 comments on commit 540002b

Please sign in to comment.