Skip to content
This repository
Browse code

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

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

0 notes on commit 3839fc8

Please sign in to comment.
Something went wrong with that request. Please try again.