spec/tests/lib/install_spec.rb in hexx-rspec-0.0.1 vs spec/tests/lib/install_spec.rb in hexx-rspec-0.1.0

- old
+ new

@@ -2,20 +2,48 @@ describe Hexx::RSpec::Install, :sandbox do describe ".start" do - before { try_in_sandbox { described_class.start } } + subject { try_in_sandbox { described_class.start options } } - it "creates necessary files" do - %w( - .rspec - Rakefile - config/metrics/simplecov.yml - ).each { |file| expect(file).to be_present_in_sandbox } - end + context "without options" do - it "adds Hexx::RSpec tasks loader to Rakefile" do - expect(read_in_sandbox "Rakefile").to include "Hexx::RSpec.install_tasks" - end - end -end + 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