Sha256: 7b089f0b547c544741e15db2a256ee28dc67d7ab5de08688b05e7e6a333019bc

Contents?: true

Size: 979 Bytes

Versions: 2

Compression:

Stored size: 979 Bytes

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 domain_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 domain_purge" do
    Sdbport::Domain::Purge.stub :new => @mock
    @mock.should_receive(:purge).and_return true
    @domain.purge.should be_true
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sdbport-0.1.1 spec/domain_spec.rb
sdbport-0.1.0 spec/domain_spec.rb