Sha256: 8693d91958d06b433df3150b6143ec8f9dd46f4cc9387eeed0614d149dfa2749

Contents?: true

Size: 1.18 KB

Versions: 13

Compression:

Stored size: 1.18 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.compatible_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.compatible_version, :accept_encoding => "" }
	end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
taps-0.3.11 spec/operation_spec.rb
dkastner-taps-0.3.11 spec/operation_spec.rb
taps-0.3.10 spec/operation_spec.rb
taps-0.3.9 spec/operation_spec.rb
taps-0.3.8 spec/operation_spec.rb
taps-0.3.7 spec/operation_spec.rb
taps-0.3.6 spec/operation_spec.rb
taps-0.3.5 spec/operation_spec.rb
taps-0.3.4 spec/operation_spec.rb
taps-0.3.3 spec/operation_spec.rb
taps-0.3.2 spec/operation_spec.rb
taps-0.3.1 spec/operation_spec.rb
taps-0.3.0 spec/operation_spec.rb