Permalink
Browse files

Woot! Passing a few basic tests that prove the structure and build ar…

…e correct!
  • Loading branch information...
1 parent 365f91f commit 3839fc8b8737b0d7c3386ae1b8eced0d3d0db9e6 @metaskills metaskills committed Sep 21, 2010
Showing with 50 additions and 5 deletions.
  1. +2 −2 Rakefile
  2. +1 −1 ext/tiny_tds/result.c
  3. +2 −2 lib/tiny_tds/client.rb
  4. +29 −0 test/build_test.rb
  5. +16 −0 test/test_helper.rb
View
@@ -8,7 +8,7 @@ def test_libs
end
def test_files
- Dir.glob("test/**/*.rb").sort
+ Dir.glob("test/**/*_test.rb").sort
end
@@ -24,6 +24,6 @@ end
task :build => [:clean, :compile]
-task :default => :test
+task :default => [:build, :test]
View
@@ -10,5 +10,5 @@ static VALUE rb_tinytds_result_test(VALUE self) {
void init_tinytds_result() {
cTinyTdsResult = rb_define_class_under(mTinyTds, "Result", rb_cObject);
- rb_define_method(cTinyTdsClient, "test", rb_tinytds_result_test, 0);
+ rb_define_method(cTinyTdsResult, "test", rb_tinytds_result_test, 0);
}
View
@@ -17,13 +17,13 @@ def self.default_query_options
def initialize(opts={})
@query_options = @@default_query_options.dup
- init_connection
+ # init_connection
user = opts[:username]
pass = opts[:password]
host = opts[:host] || 'localhost'
port = opts[:port] || 3306
database = opts[:database]
- connect(user, pass, host, port, database)
+ # connect(user, pass, host, port, database)
end
View
@@ -0,0 +1,29 @@
+require 'test_helper'
+
+class BuildTest < TinyTds::TestCase
+
+ def setup
+ @client = TinyTds::Client.new
+ @result = TinyTds::Result.new
+ end
+
+ context 'The client' do
+
+ should 'respond true to a test stub' do
+ assert @client.test
+ end
+
+ end
+
+ context 'The result' do
+
+ should 'respond true to a test stub' do
+ assert @result.test
+ end
+
+ end
+
+
+
+end
+
View
@@ -0,0 +1,16 @@
+require 'test/unit'
+require 'rubygems'
+require 'bundler'
+Bundler.setup
+require 'shoulda'
+require 'mocha'
+require 'tiny_tds'
+
+module TinyTds
+ class TestCase < Test::Unit::TestCase
+
+ def test_base_tiny_tds_case ; assert(true) ; end
+
+ end
+end
+

0 comments on commit 3839fc8

Please sign in to comment.