Sha256: d5adefad4ade7a9ebf45020a7310ed596f970e9ef3284d8bc8d35eb62cc2ed56

Contents?: true

Size: 1.19 KB

Versions: 5

Compression:

Stored size: 1.19 KB

Contents

require File.dirname(__FILE__) + '/base'
require 'taps/operation'

describe Taps::Operation do
  before do
    @op = Taps::Operation.new('dummy://localhost', 'http://x:y@localhost:5000')
  end

  it "returns an array of tables that match the regex table_filter" do
    @op = Taps::Operation.new('dummy://localhost', 'http://x:y@localhost:5000', :table_filter => 'abc')
    @op.apply_table_filter(['abc', 'def']).should == ['abc']
  end

  it "returns a hash of tables that match the regex table_filter" do
    @op = Taps::Operation.new('dummy://localhost', 'http://x:y@localhost:5000', :table_filter => 'abc')
    @op.apply_table_filter({ 'abc' => 1, 'def' => 2 }).should == { 'abc' => 1 }
  end

  it "masks a url's password" do
    @op.safe_url("mysql://root:password@localhost/mydb").should == "mysql://root:[hidden]@localhost/mydb"
  end

  it "returns http headers with compression enabled" do
    @op.http_headers.should == { :taps_version => Taps.version, :accept_encoding => "gzip, deflate" }
  end

  it "returns http headers with compression disabled" do
    @op.stubs(:compression_disabled?).returns(true)
    @op.http_headers.should == { :taps_version => Taps.version, :accept_encoding => "" }
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
taps-0.3.15 spec/operation_spec.rb
taps-jruby-0.3.14 spec/operation_spec.rb
taps-0.3.14 spec/operation_spec.rb
taps-0.3.13 spec/operation_spec.rb
taps-0.3.12 spec/operation_spec.rb