From e635321191739e1b61c553ad86619293ca6cebea Mon Sep 17 00:00:00 2001 From: Youssef Idmoussi Date: Sat, 18 Nov 2017 22:46:19 +0000 Subject: [PATCH] Update ruby version to 2.4.2 Update RSpec and deps gems to latest versions. Fix depircated RSpec code to make tests green again. Add ruby 2.4.2 to travis-ci. Add gem pry to dev dependencies to ease debuging. --- .ruby-version | 2 +- .travis.yml | 1 + escort.gemspec | 1 + spec/integration/basic_config_file_spec.rb | 21 ++++----- spec/integration/basic_conflicts_spec.rb | 6 +-- spec/integration/basic_depends_on_spec.rb | 44 +++++++++---------- spec/integration/basic_options_spec.rb | 20 ++++----- .../basic_options_with_multi_spec.rb | 6 +-- spec/integration/basic_spec.rb | 14 +++--- spec/integration/basic_validations_spec.rb | 12 ++--- spec/integration/basic_with_arguments_spec.rb | 6 +-- .../basic_with_text_fields_spec.rb | 2 +- spec/integration/suite_simple_spec.rb | 4 +- spec/integration/suite_sub_command_spec.rb | 2 +- spec/lib/escort/formatter/command_spec.rb | 14 +++--- spec/lib/escort/formatter/option_spec.rb | 12 ++--- .../escort/setup/configuration/reader_spec.rb | 1 + .../escort/setup/configuration/writer_spec.rb | 1 + spec/spec_helper.rb | 2 +- 19 files changed, 88 insertions(+), 83 deletions(-) diff --git a/.ruby-version b/.ruby-version index c031dda..8e8299d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.0.0-p0 +2.4.2 diff --git a/.travis.yml b/.travis.yml index d61e197..e7ff02d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ rvm: - "1.9.2" - "1.9.3" - "2.0.0" + - "2.4.2" - jruby-19mode # JRuby in 1.9 mode #- rbx-19mode script: bundle exec rspec spec diff --git a/escort.gemspec b/escort.gemspec index 96f0607..9844bef 100644 --- a/escort.gemspec +++ b/escort.gemspec @@ -18,6 +18,7 @@ Gem::Specification.new do |gem| gem.add_development_dependency('fakefs') gem.add_development_dependency('rake') gem.add_development_dependency('travis-lint') + gem.add_development_dependency('pry') gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } diff --git a/spec/integration/basic_config_file_spec.rb b/spec/integration/basic_config_file_spec.rb index 638f44f..41e66ae 100644 --- a/spec/integration/basic_config_file_spec.rb +++ b/spec/integration/basic_config_file_spec.rb @@ -1,3 +1,4 @@ +require 'json' describe "Escort basic app with config file defined", :integration => true do include FakeFS::SpecHelpers @@ -28,7 +29,7 @@ end let(:autocreate) {true} let(:option_string) { "" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } it("should have created a config file in default location") { File.should exist path } end @@ -44,7 +45,7 @@ end let(:autocreate) {true} let(:option_string) { "" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } it("should have picked up the existing config file") { result[:command_options][:option1].should == 'hello' } end end @@ -62,7 +63,7 @@ rescue SystemExit => e end end - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } it("should have picked up the existing config file") { result[:command_options][:option1].should == 'hello' } end @@ -75,7 +76,7 @@ rescue SystemExit => e end end - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } it("should not have created a config file in default location") { File.should_not exist path } end end @@ -95,31 +96,31 @@ context "--config global option should exist" do let(:option_string) { "--config=#{path}" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end context "escort command should exist" do let(:option_string) { "escort -h" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } context "--create-config option for escort command should exist" do let(:option_string) { "escort --create-config=#{path}" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end context "--create-default-config option for escort command should exist" do let(:option_string) { "escort --create-default-config" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end context "--update-config option for escort command should exist" do let(:option_string) { "escort --update-config=#{path}" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end context "--update-default-config option for escort command should exist" do let(:option_string) { "escort --update-default-config" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end end end diff --git a/spec/integration/basic_conflicts_spec.rb b/spec/integration/basic_conflicts_spec.rb index 2d9b00f..49eec39 100644 --- a/spec/integration/basic_conflicts_spec.rb +++ b/spec/integration/basic_conflicts_spec.rb @@ -18,12 +18,12 @@ context "when conflicting options supplied" do let(:option_string) { "--flag1 --flag2" } - it("should exit with code 2 or 3") { expect{ subject }.to exit_with_code(2, 3) } + it("should exit with code 2 or 3") { expect(subject).to exit_with_code(2, 3) } end context "when no conflicting options supplied" do let(:option_string) { "--flag1" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end context "when non-existant option in conflict list" do @@ -42,6 +42,6 @@ end end let(:option_string) { "--flag1" } - it("should exit with code 2") { expect{ subject }.to exit_with_code(2) } + it("should exit with code 2") { expect(subject).to exit_with_code(2) } end end diff --git a/spec/integration/basic_depends_on_spec.rb b/spec/integration/basic_depends_on_spec.rb index 5e13e32..91cb4b2 100644 --- a/spec/integration/basic_depends_on_spec.rb +++ b/spec/integration/basic_depends_on_spec.rb @@ -17,7 +17,7 @@ end end let(:option_string) { "-f" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "when option dependent on presence of flag" do @@ -38,12 +38,12 @@ context "and flag is not present" do let(:option_string) { "-o foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "and flag is present" do let(:option_string) { "-f -o foo" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end end @@ -69,29 +69,29 @@ context "and other flag has a default value of false" do context "and other flag is present" do let(:option_string) { "--flag1 --flag3" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end context "and other flag is not present" do let(:option_string) { "--flag3" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end end context "and other flag has a default value of true" do context "and other flag is present" do let(:option_string) { "--flag2 --flag4" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end context "and other flag is not present" do let(:option_string) { "--flag4" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end context "and other flag negative option is used" do let(:option_string) { "--no-flag2 --flag4" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end end end @@ -115,17 +115,17 @@ context "and one of the other options is not present" do let(:option_string) { "-f --option2=foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "and none of the other options are present" do let(:option_string) { "--option2=foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "and all of the other options are present" do let(:option_string) { "-f -o bar --option2=foo" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end end @@ -148,17 +148,17 @@ context "and other option is supplied with this value" do let(:option_string) { "-o bar --option2=foo" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end context "and other option is supplied with different value" do let(:option_string) { "-o baz --option2=foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "and other option is not supplied" do let(:option_string) { "--option2=foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end end @@ -181,17 +181,17 @@ context "and yet another option is not present" do let(:option_string) { "-o bar --option2=foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "and other option has different value" do let(:option_string) { "-o baz -f --option2=foo" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "and other option has the right value and yet another option is present" do let(:option_string) { "-o bar -f --option2=foo" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end end @@ -210,7 +210,7 @@ end end let(:option_string) { "-o bar" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "when dependency specified for non-existant option" do @@ -228,7 +228,7 @@ end end let(:option_string) { "-o bar" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "when option dependent on non-existant option" do @@ -246,7 +246,7 @@ end end let(:option_string) { "-o bar" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end context "when dependency is specified inline" do @@ -264,12 +264,12 @@ end context "and dependency is satisfied" do let(:option_string) { "-f -o bar" } - it("it should exit successfully") { expect{subject}.to exit_with_code(0) } + it("it should exit successfully") { expect(subject).to exit_with_code(0) } end context "and dependency is not satisfied" do let(:option_string) { "-o bar" } - it("it should not exit successfully") { expect{subject}.to_not exit_with_code(0) } + it("it should not exit successfully") { expect(subject).to_not exit_with_code(0) } end end end diff --git a/spec/integration/basic_options_spec.rb b/spec/integration/basic_options_spec.rb index fdf8738..8de5acb 100644 --- a/spec/integration/basic_options_spec.rb +++ b/spec/integration/basic_options_spec.rb @@ -15,27 +15,27 @@ context "when called with empty option string" do let(:option_string) { "" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } - it("should execute the global action") { expect{subject}.to execute_action_for_command(result, :global) } - it("option1 have its default value in action") { expect{subject}.to execute_action_with_options(result, :option1 => 'option 1') } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } + it("should execute the global action") { expect(subject).to execute_action_for_command(result, :global) } + it("option1 have its default value in action") { expect(subject).to execute_action_with_options(result, :option1 => 'option 1') } end context "when called with option string with short code option" do let(:option_string) { "-o blah" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } - it("should execute the global action") { expect{subject}.to execute_action_for_command(result, :global) } - it("option1 have the value 'blah' in action") { expect{subject}.to execute_action_with_options(result, :option1 => 'blah') } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } + it("should execute the global action") { expect(subject).to execute_action_for_command(result, :global) } + it("option1 have the value 'blah' in action") { expect(subject).to execute_action_with_options(result, :option1 => 'blah') } end context "when called with option string with long code option" do let(:option_string) { "--option1=blah" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } - it("should execute the global action") { expect{subject}.to execute_action_for_command(result, :global) } - it("option1 have the value 'blah' in action") { expect{subject}.to execute_action_with_options(result, :option1 => 'blah') } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } + it("should execute the global action") { expect(subject).to execute_action_for_command(result, :global) } + it("option1 have the value 'blah' in action") { expect(subject).to execute_action_with_options(result, :option1 => 'blah') } end context "when called with option string with unknown option" do let(:option_string) { "-k" } - it("should not exit with code 0") { expect{ subject }.not_to exit_with_code(0) } + it("should not exit with code 0") { expect(subject).not_to exit_with_code(0) } end end diff --git a/spec/integration/basic_options_with_multi_spec.rb b/spec/integration/basic_options_with_multi_spec.rb index 457c760..fb6de18 100644 --- a/spec/integration/basic_options_with_multi_spec.rb +++ b/spec/integration/basic_options_with_multi_spec.rb @@ -15,16 +15,16 @@ context "when called with empty option string" do let(:option_string) { "" } - it("option1 should be an empty array") { expect{subject}.to execute_action_with_options(result, :option1 => []) } + it("option1 should be an empty array") { expect(subject).to execute_action_with_options(result, :option1 => []) } end context "when called with option1 specified once" do let(:option_string) { "-o blah" } - it("option1 have the value ['blah'] in action") { expect{subject}.to execute_action_with_options(result, :option1 => ['blah']) } + it("option1 have the value ['blah'] in action") { expect(subject).to execute_action_with_options(result, :option1 => ['blah']) } end context "when called with option1 specified 3 times" do let(:option_string) { "-o blah --option1=blah2 -o blah3" } - it("option1 have the value ['blah', 'blah2', 'blah3'] in action") { expect{subject}.to execute_action_with_options(result, :option1 => ['blah', 'blah2', 'blah3']) } + it("option1 have the value ['blah', 'blah2', 'blah3'] in action") { expect(subject).to execute_action_with_options(result, :option1 => ['blah', 'blah2', 'blah3']) } end end diff --git a/spec/integration/basic_spec.rb b/spec/integration/basic_spec.rb index ff64e48..b48e094 100644 --- a/spec/integration/basic_spec.rb +++ b/spec/integration/basic_spec.rb @@ -11,28 +11,28 @@ context "when called with empty option string" do let(:option_string) { "" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } - it("should execute the global action") { expect{subject}.to execute_action_for_command(result, :global) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } + it("should execute the global action") { expect(subject).to execute_action_for_command(result, :global) } end context "when called with non-empty option string" do let(:option_string) { "hello" } - it("exit code should be 0") { expect{ subject }.to exit_with_code(0) } - it("should execute the global action") { expect{subject}.to execute_action_for_command(result, :global) } + it("exit code should be 0") { expect(subject).to exit_with_code(0) } + it("should execute the global action") { expect(subject).to execute_action_for_command(result, :global) } end context "gets --help option automatically" do let(:option_string) { "--help" } - it("exit code should be 0") { expect{ subject }.to exit_with_code(0) } + it("exit code should be 0") { expect(subject).to exit_with_code(0) } end context "gets --verbosity option automatically" do let(:option_string) { "--verbosity=DEBUG" } - it("exit code should be 0") { expect{ subject }.to exit_with_code(0) } + it("exit code should be 0") { expect(subject).to exit_with_code(0) } end context "gets --error-output-format option automatically" do let(:option_string) { "--error-output-format=advanced" } - it("exit code should be 0") { expect{ subject }.to exit_with_code(0) } + it("exit code should be 0") { expect(subject).to exit_with_code(0) } end end diff --git a/spec/integration/basic_validations_spec.rb b/spec/integration/basic_validations_spec.rb index e506d3d..d72815e 100644 --- a/spec/integration/basic_validations_spec.rb +++ b/spec/integration/basic_validations_spec.rb @@ -16,7 +16,7 @@ end let(:option_string) { "-o bar" } - it("should exit with code 2") { expect{ subject }.to exit_with_code(2) } + it("should exit with code 2") { expect(subject).to exit_with_code(2) } end context "when option has a validation" do @@ -35,12 +35,12 @@ context "and validation fails" do let(:option_string) { "-o baz" } - it("should exit with code 3") { expect{ subject }.to exit_with_code(3) } + it("should exit with code 3") { expect(subject).to exit_with_code(3) } end context "and validation does not fail" do let(:option_string) { "-o foo" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end end @@ -61,17 +61,17 @@ context "and one validation fails" do let(:option_string) { "--option2='hb'" } - it("should exit with code 3") { expect{ subject }.to exit_with_code(3) } + it("should exit with code 3") { expect(subject).to exit_with_code(3) } end context "and the other validation fails" do let(:option_string) { "--option2='h bssfs'" } - it("should exit with code 3") { expect{ subject }.to exit_with_code(3) } + it("should exit with code 3") { expect(subject).to exit_with_code(3) } end context "and both validations pass" do let(:option_string) { "--option2='h bssfsfsdfsdfsfsdsf'" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end end end diff --git a/spec/integration/basic_with_arguments_spec.rb b/spec/integration/basic_with_arguments_spec.rb index 55dba7c..2f79ea3 100644 --- a/spec/integration/basic_with_arguments_spec.rb +++ b/spec/integration/basic_with_arguments_spec.rb @@ -20,16 +20,16 @@ Readline.stub(:readline).and_return('1', nil) end - it("action should receive ['1'] as arguments") { expect{subject}.to execute_action_with_arguments(result, ['1']) } + it("action should receive ['1'] as arguments") { expect(subject).to execute_action_with_arguments(result, ['1']) } end context "when called with one argument" do let(:option_string) { "1" } - it("action should receive ['1'] as arguments") { expect{subject}.to execute_action_with_arguments(result, ['1']) } + it("action should receive ['1'] as arguments") { expect(subject).to execute_action_with_arguments(result, ['1']) } end context "when called with three arguments" do let(:option_string) { "1 2 3" } - it("action should receive ['1', '2', '3'] as arguments") { expect{subject}.to execute_action_with_arguments(result, ['1', '2', '3']) } + it("action should receive ['1', '2', '3'] as arguments") { expect(subject).to execute_action_with_arguments(result, ['1', '2', '3']) } end end diff --git a/spec/integration/basic_with_text_fields_spec.rb b/spec/integration/basic_with_text_fields_spec.rb index 04c98f9..634f2af 100644 --- a/spec/integration/basic_with_text_fields_spec.rb +++ b/spec/integration/basic_with_text_fields_spec.rb @@ -16,6 +16,6 @@ context "when called" do let(:option_string) { "" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end end diff --git a/spec/integration/suite_simple_spec.rb b/spec/integration/suite_simple_spec.rb index 6805b2a..cc1ea05 100644 --- a/spec/integration/suite_simple_spec.rb +++ b/spec/integration/suite_simple_spec.rb @@ -32,7 +32,7 @@ rescue SystemExit => e end end - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } it("should have the right command name") { result[:command_name].should == :command1 } it("should have have global option set") { result[:options][:global][:options][:option1].should == 'hello' } it("should have have command option set") { result[:command_options][:option2].should == 'world' } @@ -40,6 +40,6 @@ context "when using command alias" do let(:option_string) { "-o hello c1 --option2 world" } - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } end end diff --git a/spec/integration/suite_sub_command_spec.rb b/spec/integration/suite_sub_command_spec.rb index 169b3ad..1e40d12 100644 --- a/spec/integration/suite_sub_command_spec.rb +++ b/spec/integration/suite_sub_command_spec.rb @@ -42,7 +42,7 @@ rescue SystemExit => e end end - it("should exit with code 0") { expect{ subject }.to exit_with_code(0) } + it("should exit with code 0") { expect(subject).to exit_with_code(0) } it("should have the right command name") { result[:command_name].should == :sub_command1 } it("should have have sub command option set") { result[:command_options][:option3].should == 'foo' } it("should have have global option set") { result[:options][:global][:options][:option1].should == 'hello' } diff --git a/spec/lib/escort/formatter/command_spec.rb b/spec/lib/escort/formatter/command_spec.rb index c0d1ed6..99e9ad7 100644 --- a/spec/lib/escort/formatter/command_spec.rb +++ b/spec/lib/escort/formatter/command_spec.rb @@ -53,12 +53,12 @@ context "when no aliases" do let(:aliases) {[]} - it {subject.should be_false} + it {subject.should be_falsey} end context "when has an alias" do let(:aliases) {[command_alias]} - it {subject.should be_true} + it {subject.should be_truthy} end end @@ -123,7 +123,7 @@ context "when context is not global" do let(:context) {[:hello]} it{subject.split(" ").count.should == 2} - it{subject.split(" ").include?('hello').should be_true} + it{subject.split(" ").include?('hello').should be_truthy} end end @@ -157,11 +157,11 @@ end end end - it {subject.should be_false} + it {subject.should be_falsey} end context "when has child commands" do - it {subject.should be_true} + it {subject.should be_truthy} end end @@ -169,7 +169,7 @@ subject {command.requires_arguments?} context "when arguments not required" do - it {subject.should be_false} + it {subject.should be_falsey} end context "when arguments are required" do @@ -180,7 +180,7 @@ end end end - it {subject.should be_true} + it {subject.should be_truthy} end end diff --git a/spec/lib/escort/formatter/option_spec.rb b/spec/lib/escort/formatter/option_spec.rb index 23418cd..406b485 100644 --- a/spec/lib/escort/formatter/option_spec.rb +++ b/spec/lib/escort/formatter/option_spec.rb @@ -108,7 +108,7 @@ end end end - it {subject.should be_false} + it {subject.should be_falsey} end context "when conflict is defined" do @@ -123,7 +123,7 @@ end end end - it {subject.should be_true} + it {subject.should be_truthy} end end @@ -141,7 +141,7 @@ end end end - it {subject.should be_false} + it {subject.should be_falsey} end context "when dependency is defined" do @@ -156,7 +156,7 @@ end end end - it {subject.should be_true} + it {subject.should be_truthy} end end @@ -174,7 +174,7 @@ end end end - it {subject.should be_false} + it {subject.should be_falsey} end context "when validations is defined" do @@ -191,7 +191,7 @@ end end end - it {subject.should be_true} + it {subject.should be_truthy} end end diff --git a/spec/lib/escort/setup/configuration/reader_spec.rb b/spec/lib/escort/setup/configuration/reader_spec.rb index 6e1d045..1946b25 100644 --- a/spec/lib/escort/setup/configuration/reader_spec.rb +++ b/spec/lib/escort/setup/configuration/reader_spec.rb @@ -1,3 +1,4 @@ +require 'json' describe Escort::Setup::Configuration::Reader do include FakeFS::SpecHelpers diff --git a/spec/lib/escort/setup/configuration/writer_spec.rb b/spec/lib/escort/setup/configuration/writer_spec.rb index 9c40d46..d0a052e 100644 --- a/spec/lib/escort/setup/configuration/writer_spec.rb +++ b/spec/lib/escort/setup/configuration/writer_spec.rb @@ -1,3 +1,4 @@ +require 'json' describe Escort::Setup::Configuration::Writer do include FakeFS::SpecHelpers let(:writer) {Escort::Setup::Configuration::Writer.new(path, data)} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 137cd52..7017045 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,7 +15,7 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| - config.treat_symbols_as_metadata_keys_with_true_values = true + # config.treat_symbols_as_metadata_keys_with_true_values = true # depricated in newer versions. config.run_all_when_everything_filtered = true config.filter_run :focus