File: command_spec.rb

package info (click to toggle)
libdataobjects-ruby 0.10.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 336 kB
  • ctags: 200
  • sloc: ruby: 2,729; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 692 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))

describe DataObjects::Command do
  before do
    @connection = DataObjects::Connection.new('mock://localhost')
    @command = DataObjects::Command.new(@connection, 'SQL STRING')
  end

  after do
    @connection.close
  end

  %w{connection execute_non_query execute_reader set_types}.each do |meth|
    it "should respond to ##{meth}" do
      @command.should.respond_to(meth.intern)
    end
  end

  %w{execute_non_query execute_reader set_types}.each do |meth|
    it "should raise NotImplementedError on ##{meth}" do
      should.raise(NotImplementedError) { @command.send(meth.intern, nil) }
    end
  end

end