Sha256: 0fc68c04ea2792430046e0fe050b04f09642ca9b3004d673c4651e579ad51ea8

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

require "spec_helper"
require "daily_weekly_monthly/downloader"

describe DailyWeeklyMonthly::Downloader do
  describe "#call" do
    context "when the command fails" do
      subject { described_class.new "commandThatAlwaysFails 2> /dev/null" }

      it "raises a runtime error" do
        expect { subject.call }.to raise_error RuntimeError, "Failed to download backup"
      end
    end

    context "when the command succeeds" do
      subject { described_class.new "echo 'foo'" }

      it "returns the output of the command" do
        expect(subject.call).to eq "foo\n"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daily_weekly_monthly-0.0.2 spec/daily_weekly_monthly/downloader_spec.rb