Sha256: 85f365ba171efa2c05088baf600be647f21600d8ee7ef50e396dc20b2c1aa7d3

Contents?: true

Size: 734 Bytes

Versions: 16

Compression:

Stored size: 734 Bytes

Contents

describe LinuxAdmin::Partition do
  before(:each) do
    @disk = LinuxAdmin::Disk.new :path => '/dev/sda'
    @partition = LinuxAdmin::Partition.new :disk => @disk, :id => 2
  end

  describe "#path" do
    it "returns partition path" do
      expect(@partition.path).to eq('/dev/sda2')
    end
  end

  describe "#mount" do
    context "mount_point not specified" do
      it "sets default mount_point" do
        expect(described_class).to receive(:mount_point_exists?).and_return(false)
        expect(File).to receive(:directory?).with('/mnt/sda2').and_return(true)
        expect(LinuxAdmin::Common).to receive(:run!)
        @partition.mount
        expect(@partition.mount_point).to eq('/mnt/sda2')
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
linux_admin-1.2.4 spec/partition_spec.rb
linux_admin-1.2.3 spec/partition_spec.rb
linux_admin-1.2.2 spec/partition_spec.rb
linux_admin-1.2.1 spec/partition_spec.rb
linux_admin-1.0.1 spec/partition_spec.rb
linux_admin-1.2.0 spec/partition_spec.rb
linux_admin-1.1.0 spec/partition_spec.rb
linux_admin-1.0.0 spec/partition_spec.rb
linux_admin-0.20.2 spec/partition_spec.rb
linux_admin-0.20.1 spec/partition_spec.rb
linux_admin-0.20.0 spec/partition_spec.rb
linux_admin-0.19.0 spec/partition_spec.rb
linux_admin-0.18.0 spec/partition_spec.rb
linux_admin-0.17.0 spec/partition_spec.rb
linux_admin-0.16.0 spec/partition_spec.rb
linux_admin-0.15.0 spec/partition_spec.rb