rrbayes 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/rrbayes.gemspec +1 -1
  3. data/test/rrbayes_test.rb +7 -5
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/rrbayes.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rrbayes}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["hungryblank"]
data/test/rrbayes_test.rb CHANGED
@@ -2,24 +2,26 @@ require 'teststrap'
2
2
 
3
3
  include Rrbayes
4
4
 
5
+ DB_NUM = 0
6
+
5
7
  context "a new classifier" do
6
8
 
7
9
  setup do
8
- db = Redis.new :db => 'rrbayes_test'
10
+ db = Redis.new :db => DB_NUM
9
11
  db.connect_to_server
10
12
  db.flushdb
11
- @classifier = Classifier.new({:categories => %w(spam ham)}, :db => 'rrbayes_test')
13
+ @classifier = Classifier.new({:categories => %w(spam ham)}, :db => DB_NUM)
12
14
  end
13
15
 
14
16
  should("persist categories") { topic.db.set_members('categories') }.equals %w(spam ham)
15
17
 
16
18
  should("load categories") { topic.send(:load_categories) }.equals %w(spam ham)
17
19
 
18
- should("initialize with no categories") { Classifier.new.categories.map { |c| c.name } }.equals %w(spam ham)
20
+ should("initialize with no categories") { Classifier.new({}, :db => DB_NUM).categories.map { |c| c.name } }.equals %w(spam ham)
19
21
 
20
- should("initialize with same categories") { Classifier.new(:categories => %w(spam ham)).categories.map { |c| c.name } }.equals %w(spam ham)
22
+ should("initialize with same categories") { Classifier.new({:categories => %w(spam ham)}, :db => DB_NUM).categories.map { |c| c.name } }.equals %w(spam ham)
21
23
 
22
- should("detect category mismatch") { Classifier.new({:categories => %w(bad good)}) }.raises(LoadingError)
24
+ should("detect category mismatch") { Classifier.new({:categories => %w(bad good)}, :db => DB_NUM) }.raises(LoadingError)
23
25
 
24
26
  context "in training" do
25
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rrbayes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - hungryblank