Sha256: 4eef18627413c7050bd4c8f5087822457a65e62a5d171c438e083dca9db119d8

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# encoding: utf-8

describe Hexx::RSpec::Install, :sandbox do

  describe ".start", :capture do

    subject { try_in_sandbox { described_class.start options } }

    context "without options" do

      let(:options) { %w() }
      before { subject }

      it "creates necessary files" do
        %w(
          .rspec
          Rakefile
          config/metrics/simplecov.yml
        ).each { |file| expect(file).to be_present_in_sandbox }
      end

      it "adds Hexx::RSpec tasks loader to Rakefile" do
        expect(read_in_sandbox "Rakefile")
          .to include "Hexx::RSpec.install_tasks"
      end

    end # context

    context "--no-rakefile" do

      let(:options) { %w(--no-rakefile) }
      before { subject }

      it "creates necessary files" do
        %w(
          .rspec
          config/metrics/simplecov.yml
        ).each { |file| expect(file).to be_present_in_sandbox }
      end

      it "doesn't create a Rakefile" do
        expect("Rakefile").to be_absent_in_sandbox
      end

    end # context

  end # describe .start

end # describe Hexx::RSpec::Install

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hexx-rspec-0.3.1 spec/tests/lib/install_spec.rb
hexx-rspec-0.3.0 spec/tests/lib/install_spec.rb
hexx-rspec-0.2.2 spec/tests/lib/install_spec.rb
hexx-rspec-0.2.1 spec/tests/lib/install_spec.rb