spec/teaspoon/configuration_spec.rb in teaspoon-0.8.0 vs spec/teaspoon/configuration_spec.rb in teaspoon-0.9.0

- old
+ new

@@ -17,24 +17,25 @@ end it "sets configured to true" do subject.configured = false subject.configure { } - expect(subject.configured).to be_true + expect(subject.configured).to be_truthy end it "overrides configuration from ENV" do - subject.configuration.should_receive(:override_from_env).with(ENV) + expect(subject.configuration).to receive(:override_from_env).with(ENV) subject.configure { } end end describe ".setup" do it "calls configure" do - subject.should_receive(:configure).with(&block = proc{}) + block = proc{} + expect(subject).to receive(:configure).with(no_args) { |&arg| expect(arg).to eq(block) } subject.setup(&block) end end @@ -73,13 +74,13 @@ expect(subject.server).to be_nil expect(subject.server_port).to be_nil expect(subject.server_timeout).to eq(20) expect(subject.formatters).to eq(['dot']) expect(subject.use_coverage).to be_nil - expect(subject.fail_fast).to be_true - expect(subject.suppress_log).to be_false - expect(subject.color).to be_true + expect(subject.fail_fast).to be_truthy + expect(subject.suppress_log).to be_falsey + expect(subject.color).to be_truthy expect(subject.suite_configs).to be_a(Hash) expect(subject.coverage_configs).to be_a(Hash) end @@ -125,25 +126,25 @@ end describe ".override_from_options" do it "allows overriding from options" do - subject.should_receive(:fail_fast=).with(true) - subject.should_receive(:driver_timeout=).with(123) - subject.should_receive(:driver=).with("driver") + expect(subject).to receive(:fail_fast=).with(true) + expect(subject).to receive(:driver_timeout=).with(123) + expect(subject).to receive(:driver=).with("driver") subject.send(:override_from_options, fail_fast: true, driver_timeout: 123, driver: "driver") end end describe ".override_from_env" do it "allows overriding from the env" do - subject.should_receive(:fail_fast=).with(true) - subject.should_receive(:driver_timeout=).with(123) - subject.should_receive(:driver=).with("driver") + expect(subject).to receive(:fail_fast=).with(true) + expect(subject).to receive(:driver_timeout=).with(123) + expect(subject).to receive(:driver=).with("driver") subject.send(:override_from_env, "FAIL_FAST" => "true", "DRIVER_TIMEOUT" => "123", "DRIVER" => "driver") end end @@ -159,10 +160,11 @@ expect(subject.matcher).to eq("{spec/javascripts,spec/dummy/app/assets/javascripts/specs}/**/*_spec.{js,js.coffee,coffee,js.coffee.erb}") expect(subject.helper).to eq("spec_helper") expect(subject.javascripts).to eq(["jasmine/1.3.1", "teaspoon/jasmine"]) expect(subject.stylesheets).to eq(["teaspoon"]) expect(subject.no_coverage).to eq([%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]) + expect(subject.expand_assets).to eq(true) end it "accepts a block that can override defaults" do @suite = proc{ |s| s.helper = "helper_file" } expect(subject.helper).to eq("helper_file") @@ -190,15 +192,21 @@ describe "exceptions" do it "shows an error for unknown frameworks" do @suite = proc{ |s| s.use_framework :foo } - expect{ subject }.to raise_error Teaspoon::UnknownFramework, "Unknown framework \"foo\"" + expect{ subject }.to raise_error( + Teaspoon::UnknownFramework, + "Unknown framework \"foo\"" + ) end it "shows an error for unknown versions" do @suite = proc{ |s| s.use_framework :qunit, "666" } - expect{ subject }.to raise_error Teaspoon::UnknownFramework, "Unknown framework \"qunit\" with version 666 -- available versions 1.12.0, 1.14.0" + expect{ subject }.to raise_error( + Teaspoon::UnknownFramework, + "Unknown framework \"qunit\" with version 666 -- available versions 1.12.0, 1.14.0" + ) end end end