spec/flydata/command/sync_spec.rb in flydata-0.1.9 vs spec/flydata/command/sync_spec.rb in flydata-0.1.10
- old
+ new
@@ -298,25 +298,25 @@
describe '.create' do
context 'with nil forwarder_key' do
it 'should return TcpForwarder object' do
forwarder = ForwarderFactory.create(nil, 'test_tag', ['localhost:3456', 'localhost:4567'])
- expect(forwarder.kind_of?(TcpForwarder)).to be_true
+ expect(forwarder.kind_of?(TcpForwarder)).to be_truthy
end
end
context 'with tcpforwarder forwarder_key' do
it 'should return TcpForwarder object' do
forwarder = ForwarderFactory.create('tcpforwarder', 'test_tag', ['localhost:3456', 'localhost:4567'])
- expect(forwarder.kind_of?(TcpForwarder)).to be_true
+ expect(forwarder.kind_of?(TcpForwarder)).to be_truthy
end
end
context 'with sslforwarder forwarder_key' do
it 'should return SslForwarder object' do
forwarder = ForwarderFactory.create('sslforwarder', 'test_tag', ['localhost:3456', 'localhost:4567'])
- expect(forwarder.kind_of?(SslForwarder)).to be_true
+ expect(forwarder.kind_of?(SslForwarder)).to be_truthy
end
end
end
describe '#initialize' do
@@ -395,19 +395,19 @@
let(:default_dump_generator) { MysqlDumpGeneratorMasterData.new(default_conf) }
describe '#initialize' do
context 'with password' do
subject { default_dump_generator.instance_variable_get(:@dump_cmd) }
- it { should eq('mysqldump --protocol=tcp -h localhost -P 3306 -uadmin -ppass --skip-lock-tables ' +
+ it { is_expected.to eq('mysqldump --protocol=tcp -h localhost -P 3306 -uadmin -ppass --skip-lock-tables ' +
'--single-transaction --hex-blob --flush-logs --master-data=2 dev users groups') }
end
context 'without password' do
let (:dump_generator) do
MysqlDumpGeneratorMasterData.new(default_conf.merge({'password' => ''}))
end
subject { dump_generator.instance_variable_get(:@dump_cmd) }
- it { should eq('mysqldump --protocol=tcp -h localhost -P 3306 -uadmin --skip-lock-tables ' +
+ it { is_expected.to eq('mysqldump --protocol=tcp -h localhost -P 3306 -uadmin --skip-lock-tables ' +
'--single-transaction --hex-blob --flush-logs --master-data=2 dev users groups') }
end
end
describe '#dump' do
@@ -419,11 +419,11 @@
['(dummy std out)', '(dummy std err)', status]
)
end
it do
expect{ default_dump_generator.dump(file_path) }.to raise_error
- expect(File.exists?(file_path)).to be_false
+ expect(File.exists?(file_path)).to be_falsey
end
end
context 'when exit status is 0 but no file' do
before do
expect(status).to receive(:exitstatus).and_return 0
@@ -431,11 +431,11 @@
['(dummy std out)', '(dummy std err)', status]
)
end
it do
expect{ default_dump_generator.dump(file_path) }.to raise_error
- expect(File.exists?(file_path)).to be_false
+ expect(File.exists?(file_path)).to be_falsey
end
end
context 'when exit status is 0 but file size is 0' do
before do
`touch #{file_path}`
@@ -444,11 +444,11 @@
['(dummy std out)', '(dummy std err)', status]
)
end
it do
expect{ default_dump_generator.dump(file_path) }.to raise_error
- expect(File.exists?(file_path)).to be_true
+ expect(File.exists?(file_path)).to be_truthy
end
end
context 'when exit status is 0' do
before do
`echo "something..." > #{file_path}`
@@ -456,11 +456,11 @@
expect(Open3).to receive(:capture3).and_return(
['(dummy std out)', '(dummy std err)', status]
)
end
it do
- expect(default_dump_generator.dump(file_path)).to be_true
- expect(File.exists?(file_path)).to be_true
+ expect(default_dump_generator.dump(file_path)).to be_truthy
+ expect(File.exists?(file_path)).to be_truthy
end
end
after :each do
File.delete(file_path) if File.exists?(file_path)
end