Sha256: 5c84587bd51e3aa0bcca02b78b9144e89010d81fe8b43981ebadfa1a558e8dda

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 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 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

  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

3 entries across 3 versions & 1 rubygems

Version Path
sdbport-0.3.0 spec/domain_spec.rb
sdbport-0.2.1 spec/domain_spec.rb
sdbport-0.2.0 spec/domain_spec.rb