File: dataset_run_spec.rb

package info (click to toggle)
ruby-sequel 5.97.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,188 kB
  • sloc: ruby: 123,115; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 510 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative "spec_helper"

describe "dataset_run extension" do
  it "#run should run the SQL on the database" do
    db = Sequel.mock
    db["SQL with ?", "placeholder"].extension(:dataset_run).run.must_be_nil
    db.sqls.must_equal ["SQL with 'placeholder'"]
  end

  it "#run should respect current server" do
    db = Sequel.mock(:servers=>{:a=>{}})
    db["SQL with ?", "placeholder"].extension(:dataset_run).server(:a).run.must_be_nil
    db.sqls.must_equal ["SQL with 'placeholder' -- a"]
  end
end