Sha256: a098cfcf5692291aa7ba42f6c1452dc2f0fb0858d7d5e8df6a2586d5bef157c6

Contents?: true

Size: 1.5 KB

Versions: 2

Compression:

Stored size: 1.5 KB

Contents

require 'spec_helper'

describe Sdbport do
  before do
    @mock = mock
    @domain = Sdbport::Domain.new :args1 => 'val1'
  end

  it "should call domain_import from the given input" do
    Sdbport::Domain::Import.should_receive(:new).
                            with(:args1 => 'val1').
                            and_return @mock
    @mock.should_receive(:import).with('/tmp/file').
          and_return true
    @domain.import('/tmp/file').should be_true
  end

  it "should call export from the given output" do
    Sdbport::Domain::Export.should_receive(:new).
                            with(:args1 => 'val1').
                            and_return @mock
    @mock.should_receive(:export).with('/tmp/file').
          and_return true
    @domain.export('/tmp/file').should be_true
  end

  it "should call export_sequential_write with the given output" do
    Sdbport::Domain::Export.should_receive(:new).
                            with(:args1 => 'val1').
                            and_return @mock
    @mock.should_receive(:export_sequential_write).with('/tmp/file').
          and_return true
    @domain.export_sequential_write('/tmp/file').should be_true
  end

  it "should call domain_purge" do
    Sdbport::Domain::Purge.stub :new => @mock
    @mock.should_receive(:purge).and_return true
    @domain.purge.should be_true
  end

  it "should call domain_destroy" do
    Sdbport::Domain::Destroy.stub :new => @mock
    @mock.should_receive(:destroy).and_return true
    @domain.destroy.should be_true
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sdbport-0.4.1 spec/domain_spec.rb
sdbport-0.4.0 spec/domain_spec.rb