From dab393ee217b43f9e007cc269b7be8c26974642e Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 15 Feb 2018 16:03:13 +0100 Subject: [PATCH] Disable moneky patching with RSpec --- spec/rackstash/adapter/base_adapter_spec.rb | 2 +- spec/rackstash/adapter/callable_spec.rb | 4 ++-- spec/rackstash/adapter/file_spec.rb | 2 +- spec/rackstash/adapter/io_spec.rb | 4 ++-- spec/rackstash/adapter/logger_spec.rb | 4 ++-- spec/rackstash/adapter/null_spec.rb | 4 ++-- spec/rackstash/adapter_spec.rb | 2 +- spec/rackstash/buffer_spec.rb | 4 ++-- spec/rackstash/buffer_stack_spec.rb | 4 ++-- spec/rackstash/class_registry_spec.rb | 2 +- spec/rackstash/encoder/hash_spec.rb | 4 ++-- spec/rackstash/encoder/helper/message_spec.rb | 4 ++-- spec/rackstash/encoder/helper/timestamp_spec.rb | 4 ++-- spec/rackstash/encoder/json_spec.rb | 2 +- spec/rackstash/encoder/lograge_spec.rb | 4 ++-- spec/rackstash/encoder/logstash_spec.rb | 2 +- spec/rackstash/encoder/message_spec.rb | 2 +- spec/rackstash/encoder/raw_spec.rb | 4 ++-- spec/rackstash/encoder_spec.rb | 2 +- spec/rackstash/fields/abstract_collection_spec.rb | 4 ++-- spec/rackstash/fields/array_spec.rb | 4 ++-- spec/rackstash/fields/hash_spec.rb | 2 +- spec/rackstash/fields/tags_spec.rb | 4 ++-- spec/rackstash/filter/anonymize_ip_mask_spec.rb | 2 +- spec/rackstash/filter/clear_color_spec.rb | 4 ++-- spec/rackstash/filter/default_fields_spec.rb | 4 ++-- spec/rackstash/filter/default_tags_spec.rb | 4 ++-- spec/rackstash/filter/drop_if_spec.rb | 4 ++-- spec/rackstash/filter/remove_spec.rb | 2 +- spec/rackstash/filter/rename_spec.rb | 4 ++-- spec/rackstash/filter/replace_spec.rb | 4 ++-- spec/rackstash/filter/select_spec.rb | 2 +- spec/rackstash/filter/truncate_message_spec.rb | 4 ++-- spec/rackstash/filter/update_spec.rb | 4 ++-- spec/rackstash/filter_chain_spec.rb | 4 ++-- spec/rackstash/filter_spec.rb | 2 +- spec/rackstash/flow_spec.rb | 2 +- spec/rackstash/flows_spec.rb | 4 ++-- spec/rackstash/formatter_spec.rb | 6 +++--- spec/rackstash/helpers/time_spec.rb | 4 ++-- spec/rackstash/helpers/utf8_spec.rb | 4 ++-- spec/rackstash/logger_spec.rb | 4 ++-- spec/rackstash/message_spec.rb | 4 ++-- spec/rackstash/rack/errors_spec.rb | 4 ++-- spec/rackstash/rack/middleware_spec.rb | 2 +- spec/rackstash/version_spec.rb | 4 ++-- spec/rackstash_spec.rb | 4 ++-- spec/spec_helper.rb | 5 ++++- 48 files changed, 84 insertions(+), 81 deletions(-) diff --git a/spec/rackstash/adapter/base_adapter_spec.rb b/spec/rackstash/adapter/base_adapter_spec.rb index 814b7a1..9e7aaf7 100644 --- a/spec/rackstash/adapter/base_adapter_spec.rb +++ b/spec/rackstash/adapter/base_adapter_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/adapter/base_adapter' -describe Rackstash::Adapter::BaseAdapter do +RSpec.describe Rackstash::Adapter::BaseAdapter do let(:adapter) { described_class.new } describe '.parse_uri_options' do diff --git a/spec/rackstash/adapter/callable_spec.rb b/spec/rackstash/adapter/callable_spec.rb index 285ca3c..4ea9f61 100644 --- a/spec/rackstash/adapter/callable_spec.rb +++ b/spec/rackstash/adapter/callable_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/adapter/callable' -describe Rackstash::Adapter::Callable do +RSpec.describe Rackstash::Adapter::Callable do let(:callable) { ->(log) { log } } let(:adapter) { described_class.new(callable) } diff --git a/spec/rackstash/adapter/file_spec.rb b/spec/rackstash/adapter/file_spec.rb index 3c7dd88..5ad4efe 100644 --- a/spec/rackstash/adapter/file_spec.rb +++ b/spec/rackstash/adapter/file_spec.rb @@ -11,7 +11,7 @@ require 'tmpdir' require 'rackstash/adapter/file' -describe Rackstash::Adapter::File do +RSpec.describe Rackstash::Adapter::File do let!(:logfile) { Tempfile.new('') } let(:adapter_args) { {} } diff --git a/spec/rackstash/adapter/io_spec.rb b/spec/rackstash/adapter/io_spec.rb index 8f8f528..bb345a8 100644 --- a/spec/rackstash/adapter/io_spec.rb +++ b/spec/rackstash/adapter/io_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -11,7 +11,7 @@ require 'tempfile' require 'rackstash/adapter/io' -describe Rackstash::Adapter::IO do +RSpec.describe Rackstash::Adapter::IO do let(:io) { StringIO.new } let(:adapter) { described_class.new(io) } diff --git a/spec/rackstash/adapter/logger_spec.rb b/spec/rackstash/adapter/logger_spec.rb index eaeeca1..499fcb9 100644 --- a/spec/rackstash/adapter/logger_spec.rb +++ b/spec/rackstash/adapter/logger_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -10,7 +10,7 @@ require 'stringio' require 'rackstash/adapter/logger' -describe Rackstash::Adapter::Logger do +RSpec.describe Rackstash::Adapter::Logger do let(:bucket) { Struct.new(:lines) do def initialize(*args) diff --git a/spec/rackstash/adapter/null_spec.rb b/spec/rackstash/adapter/null_spec.rb index 13b7bb2..8c29bf1 100644 --- a/spec/rackstash/adapter/null_spec.rb +++ b/spec/rackstash/adapter/null_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/adapter/null' -describe Rackstash::Adapter::Null do +RSpec.describe Rackstash::Adapter::Null do let(:adapter) { described_class.new } describe '#initialize' do diff --git a/spec/rackstash/adapter_spec.rb b/spec/rackstash/adapter_spec.rb index ea2aa40..b45e54a 100644 --- a/spec/rackstash/adapter_spec.rb +++ b/spec/rackstash/adapter_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/adapter' -describe Rackstash::Adapter do +RSpec.describe Rackstash::Adapter do around(:each) do |example| types = described_class.send(:adapter_types) schemes = described_class.send(:adapter_schemes) diff --git a/spec/rackstash/buffer_spec.rb b/spec/rackstash/buffer_spec.rb index 497b88d..00324a7 100644 --- a/spec/rackstash/buffer_spec.rb +++ b/spec/rackstash/buffer_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/buffer' -describe Rackstash::Buffer do +RSpec.describe Rackstash::Buffer do let(:buffer_options) { {} } let(:flows) { instance_double(Rackstash::Flows) } let(:buffer) { described_class.new(flows, **buffer_options) } diff --git a/spec/rackstash/buffer_stack_spec.rb b/spec/rackstash/buffer_stack_spec.rb index 32e4b97..82edbed 100644 --- a/spec/rackstash/buffer_stack_spec.rb +++ b/spec/rackstash/buffer_stack_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/buffer_stack' -describe Rackstash::BufferStack do +RSpec.describe Rackstash::BufferStack do let(:flows) { instance_double(Rackstash::Flows) } let(:stack) { described_class.new(flows) } diff --git a/spec/rackstash/class_registry_spec.rb b/spec/rackstash/class_registry_spec.rb index f7ca786..0bad331 100644 --- a/spec/rackstash/class_registry_spec.rb +++ b/spec/rackstash/class_registry_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/class_registry' -describe Rackstash::ClassRegistry do +RSpec.describe Rackstash::ClassRegistry do let(:registry) { described_class.new('value') } let(:klass) { Class.new } diff --git a/spec/rackstash/encoder/hash_spec.rb b/spec/rackstash/encoder/hash_spec.rb index 8701b53..c89da42 100644 --- a/spec/rackstash/encoder/hash_spec.rb +++ b/spec/rackstash/encoder/hash_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/hash' -describe Rackstash::Encoder::Hash do +RSpec.describe Rackstash::Encoder::Hash do let(:encoder) { described_class.new } describe '#encode' do diff --git a/spec/rackstash/encoder/helper/message_spec.rb b/spec/rackstash/encoder/helper/message_spec.rb index d9bd784..14900ec 100644 --- a/spec/rackstash/encoder/helper/message_spec.rb +++ b/spec/rackstash/encoder/helper/message_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/helper/message' -describe Rackstash::Encoder::Helper::Message do +RSpec.describe Rackstash::Encoder::Helper::Message do let(:helper) { helper = Object.new.extend(described_class) described_class.private_instance_methods(false).each do |method| diff --git a/spec/rackstash/encoder/helper/timestamp_spec.rb b/spec/rackstash/encoder/helper/timestamp_spec.rb index 70b30cb..c87feb2 100644 --- a/spec/rackstash/encoder/helper/timestamp_spec.rb +++ b/spec/rackstash/encoder/helper/timestamp_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/helper/timestamp' -describe Rackstash::Encoder::Helper::Timestamp do +RSpec.describe Rackstash::Encoder::Helper::Timestamp do let(:helper) { helper = Object.new.extend(described_class) described_class.private_instance_methods(false).each do |method| diff --git a/spec/rackstash/encoder/json_spec.rb b/spec/rackstash/encoder/json_spec.rb index 7d79566..96a0f90 100644 --- a/spec/rackstash/encoder/json_spec.rb +++ b/spec/rackstash/encoder/json_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/json' -describe Rackstash::Encoder::JSON do +RSpec.describe Rackstash::Encoder::JSON do let(:encoder) { described_class.new } describe '#encode' do diff --git a/spec/rackstash/encoder/lograge_spec.rb b/spec/rackstash/encoder/lograge_spec.rb index cff1e8b..b540176 100644 --- a/spec/rackstash/encoder/lograge_spec.rb +++ b/spec/rackstash/encoder/lograge_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/lograge' -describe Rackstash::Encoder::Lograge do +RSpec.describe Rackstash::Encoder::Lograge do let(:encoder) { described_class.new } describe '#encode' do diff --git a/spec/rackstash/encoder/logstash_spec.rb b/spec/rackstash/encoder/logstash_spec.rb index 4c0bd2e..79ad454 100644 --- a/spec/rackstash/encoder/logstash_spec.rb +++ b/spec/rackstash/encoder/logstash_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/logstash' -describe Rackstash::Encoder::Logstash do +RSpec.describe Rackstash::Encoder::Logstash do let(:encoder) { described_class.new } describe '#encode' do diff --git a/spec/rackstash/encoder/message_spec.rb b/spec/rackstash/encoder/message_spec.rb index e07abde..db1242d 100644 --- a/spec/rackstash/encoder/message_spec.rb +++ b/spec/rackstash/encoder/message_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/message' -describe Rackstash::Encoder::Message do +RSpec.describe Rackstash::Encoder::Message do let(:tagged) { [] } let(:encoder) { described_class.new(tagged: tagged) } diff --git a/spec/rackstash/encoder/raw_spec.rb b/spec/rackstash/encoder/raw_spec.rb index 356119a..451d5de 100644 --- a/spec/rackstash/encoder/raw_spec.rb +++ b/spec/rackstash/encoder/raw_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/encoder/raw' -describe Rackstash::Encoder::Raw do +RSpec.describe Rackstash::Encoder::Raw do let(:encoder) { described_class.new } describe '#encode' do diff --git a/spec/rackstash/encoder_spec.rb b/spec/rackstash/encoder_spec.rb index 6d9c2bd..301a607 100644 --- a/spec/rackstash/encoder_spec.rb +++ b/spec/rackstash/encoder_spec.rb @@ -10,7 +10,7 @@ require 'securerandom' require 'rackstash/encoder' -describe Rackstash::Encoder do +RSpec.describe Rackstash::Encoder do let(:registry) { Rackstash::ClassRegistry.new('encoder') } let(:encoder_class) { diff --git a/spec/rackstash/fields/abstract_collection_spec.rb b/spec/rackstash/fields/abstract_collection_spec.rb index 7b3f1a8..81bbdbe 100644 --- a/spec/rackstash/fields/abstract_collection_spec.rb +++ b/spec/rackstash/fields/abstract_collection_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -11,7 +11,7 @@ require 'rackstash/fields/abstract_collection' require 'rackstash/fields/array' require 'rackstash/fields/hash' -describe Rackstash::Fields::AbstractCollection do +RSpec.describe Rackstash::Fields::AbstractCollection do let(:collection) { described_class.new } def normalize(*args) diff --git a/spec/rackstash/fields/array_spec.rb b/spec/rackstash/fields/array_spec.rb index 7270801..bde2bcb 100644 --- a/spec/rackstash/fields/array_spec.rb +++ b/spec/rackstash/fields/array_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/fields/array' -describe Rackstash::Fields::Array do +RSpec.describe Rackstash::Fields::Array do let(:array) { described_class.new } describe '#+' do diff --git a/spec/rackstash/fields/hash_spec.rb b/spec/rackstash/fields/hash_spec.rb index 555c80b..8348b83 100644 --- a/spec/rackstash/fields/hash_spec.rb +++ b/spec/rackstash/fields/hash_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/fields/hash' -describe Rackstash::Fields::Hash do +RSpec.describe Rackstash::Fields::Hash do let(:forbidden_keys) { Set.new } let(:hash) { Rackstash::Fields::Hash.new(forbidden_keys: forbidden_keys) } diff --git a/spec/rackstash/fields/tags_spec.rb b/spec/rackstash/fields/tags_spec.rb index 0d0c099..fd03ebf 100644 --- a/spec/rackstash/fields/tags_spec.rb +++ b/spec/rackstash/fields/tags_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/fields/tags' -describe Rackstash::Fields::Tags do +RSpec.describe Rackstash::Fields::Tags do let(:tags) { described_class.new } describe '#<<' do diff --git a/spec/rackstash/filter/anonymize_ip_mask_spec.rb b/spec/rackstash/filter/anonymize_ip_mask_spec.rb index efc7aba..bb5069b 100644 --- a/spec/rackstash/filter/anonymize_ip_mask_spec.rb +++ b/spec/rackstash/filter/anonymize_ip_mask_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/anonymize_ip_mask' -describe Rackstash::Filter::AnonymizeIPMask do +RSpec.describe Rackstash::Filter::AnonymizeIPMask do let(:event) { { 'ipv4' => '10.123.42.65', diff --git a/spec/rackstash/filter/clear_color_spec.rb b/spec/rackstash/filter/clear_color_spec.rb index d39a4aa..4632fbe 100644 --- a/spec/rackstash/filter/clear_color_spec.rb +++ b/spec/rackstash/filter/clear_color_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/clear_color' -describe Rackstash::Filter::ClearColor do +RSpec.describe Rackstash::Filter::ClearColor do let(:filter) { described_class.new } it 'removes any ANSI color codes from the message' do diff --git a/spec/rackstash/filter/default_fields_spec.rb b/spec/rackstash/filter/default_fields_spec.rb index 5a63800..6114c6a 100644 --- a/spec/rackstash/filter/default_fields_spec.rb +++ b/spec/rackstash/filter/default_fields_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/default_fields' -describe Rackstash::Filter::DefaultFields do +RSpec.describe Rackstash::Filter::DefaultFields do let(:event) { { 'foo' => 'v1', diff --git a/spec/rackstash/filter/default_tags_spec.rb b/spec/rackstash/filter/default_tags_spec.rb index d809e73..5593412 100644 --- a/spec/rackstash/filter/default_tags_spec.rb +++ b/spec/rackstash/filter/default_tags_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/default_tags' -describe Rackstash::Filter::DefaultTags do +RSpec.describe Rackstash::Filter::DefaultTags do let(:event) { { 'key' => 'value' diff --git a/spec/rackstash/filter/drop_if_spec.rb b/spec/rackstash/filter/drop_if_spec.rb index 311073e..74c820b 100644 --- a/spec/rackstash/filter/drop_if_spec.rb +++ b/spec/rackstash/filter/drop_if_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/drop_if' -describe Rackstash::Filter::DropIf do +RSpec.describe Rackstash::Filter::DropIf do describe '#initialize' do it 'expects a condition' do expect { described_class.new }.to raise_error ArgumentError diff --git a/spec/rackstash/filter/remove_spec.rb b/spec/rackstash/filter/remove_spec.rb index cd450f6..3be9dfd 100644 --- a/spec/rackstash/filter/remove_spec.rb +++ b/spec/rackstash/filter/remove_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/remove' -describe Rackstash::Filter::Remove do +RSpec.describe Rackstash::Filter::Remove do let(:event) { { 'foo' => 'foo value', diff --git a/spec/rackstash/filter/rename_spec.rb b/spec/rackstash/filter/rename_spec.rb index 9ca1bc5..351c333 100644 --- a/spec/rackstash/filter/rename_spec.rb +++ b/spec/rackstash/filter/rename_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/rename' -describe Rackstash::Filter::Rename do +RSpec.describe Rackstash::Filter::Rename do let(:event) { { 'foo' => 'foo value', diff --git a/spec/rackstash/filter/replace_spec.rb b/spec/rackstash/filter/replace_spec.rb index 98f19e5..d96b9d6 100644 --- a/spec/rackstash/filter/replace_spec.rb +++ b/spec/rackstash/filter/replace_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/replace' -describe Rackstash::Filter::Replace do +RSpec.describe Rackstash::Filter::Replace do let(:event) { { 'foo' => 'foo value', diff --git a/spec/rackstash/filter/select_spec.rb b/spec/rackstash/filter/select_spec.rb index d172c0b..2049216 100644 --- a/spec/rackstash/filter/select_spec.rb +++ b/spec/rackstash/filter/select_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/select' -describe Rackstash::Filter::Select do +RSpec.describe Rackstash::Filter::Select do let(:event) { { 'foo' => 'foo value', diff --git a/spec/rackstash/filter/truncate_message_spec.rb b/spec/rackstash/filter/truncate_message_spec.rb index 4bc1157..2dae3d4 100644 --- a/spec/rackstash/filter/truncate_message_spec.rb +++ b/spec/rackstash/filter/truncate_message_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/truncate_message' -describe Rackstash::Filter::TruncateMessage do +RSpec.describe Rackstash::Filter::TruncateMessage do let(:max_size) { 36 } let(:args) { { selectors: [], cut: :bottom } } let(:filter) { described_class.new(max_size, **args) } diff --git a/spec/rackstash/filter/update_spec.rb b/spec/rackstash/filter/update_spec.rb index 20f1d71..a58e7ad 100644 --- a/spec/rackstash/filter/update_spec.rb +++ b/spec/rackstash/filter/update_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter/update' -describe Rackstash::Filter::Update do +RSpec.describe Rackstash::Filter::Update do let(:event) { { 'foo' => 'foo value', diff --git a/spec/rackstash/filter_chain_spec.rb b/spec/rackstash/filter_chain_spec.rb index 296a794..8aff1eb 100644 --- a/spec/rackstash/filter_chain_spec.rb +++ b/spec/rackstash/filter_chain_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/filter_chain' -describe Rackstash::FilterChain do +RSpec.describe Rackstash::FilterChain do Struct.new('MyFilter') do def call(event) event diff --git a/spec/rackstash/filter_spec.rb b/spec/rackstash/filter_spec.rb index 0c8fa1d..77f7111 100644 --- a/spec/rackstash/filter_spec.rb +++ b/spec/rackstash/filter_spec.rb @@ -10,7 +10,7 @@ require 'securerandom' require 'rackstash/filter' -describe Rackstash::Filter do +RSpec.describe Rackstash::Filter do let(:registry) { Rackstash::ClassRegistry.new('filter') } let(:filter_class) { diff --git a/spec/rackstash/flow_spec.rb b/spec/rackstash/flow_spec.rb index f4dc4ae..57db900 100644 --- a/spec/rackstash/flow_spec.rb +++ b/spec/rackstash/flow_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/flow' -describe Rackstash::Flow do +RSpec.describe Rackstash::Flow do let(:adapter) { Rackstash::Adapter::Null.new } let(:flow_args) { {} } let(:flow) { described_class.new(adapter, **flow_args) } diff --git a/spec/rackstash/flows_spec.rb b/spec/rackstash/flows_spec.rb index eff68c9..9632ffa 100644 --- a/spec/rackstash/flows_spec.rb +++ b/spec/rackstash/flows_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -10,7 +10,7 @@ require 'spec_helper' require 'rackstash/flows' require 'rackstash/flow' -describe Rackstash::Flows do +RSpec.describe Rackstash::Flows do let(:flows) { described_class.new } def a_flow diff --git a/spec/rackstash/formatter_spec.rb b/spec/rackstash/formatter_spec.rb index 2d6c3ce..4ac3fb2 100644 --- a/spec/rackstash/formatter_spec.rb +++ b/spec/rackstash/formatter_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -10,7 +10,7 @@ require 'spec_helper' require 'time' require 'rackstash/formatter' -describe Rackstash::Formatter do +RSpec.describe Rackstash::Formatter do let(:formatter) { described_class.new } it 'formats plain strings' do @@ -59,7 +59,7 @@ describe Rackstash::Formatter do end end -describe Rackstash::RawFormatter do +RSpec.describe Rackstash::RawFormatter do let(:formatter) { described_class.new } it 'returns the message' do diff --git a/spec/rackstash/helpers/time_spec.rb b/spec/rackstash/helpers/time_spec.rb index b6b9867..4a0f9e7 100644 --- a/spec/rackstash/helpers/time_spec.rb +++ b/spec/rackstash/helpers/time_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/helpers/time' -describe Rackstash::Helpers::Time do +RSpec.describe Rackstash::Helpers::Time do it 'only defines protected methods' do expect(described_class.public_instance_methods(false)).to be_empty end diff --git a/spec/rackstash/helpers/utf8_spec.rb b/spec/rackstash/helpers/utf8_spec.rb index 22e3295..8c7f19d 100644 --- a/spec/rackstash/helpers/utf8_spec.rb +++ b/spec/rackstash/helpers/utf8_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/helpers/utf8' -describe Rackstash::Helpers::UTF8 do +RSpec.describe Rackstash::Helpers::UTF8 do it 'only defines protected methods' do expect(described_class.public_instance_methods(false)).to be_empty end diff --git a/spec/rackstash/logger_spec.rb b/spec/rackstash/logger_spec.rb index ce41b09..36643ac 100644 --- a/spec/rackstash/logger_spec.rb +++ b/spec/rackstash/logger_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/logger' -describe Rackstash::Logger do +RSpec.describe Rackstash::Logger do let(:target) { StringIO.new } let(:logger) { described_class.new(target) } diff --git a/spec/rackstash/message_spec.rb b/spec/rackstash/message_spec.rb index 27c7a49..aa3bd6b 100644 --- a/spec/rackstash/message_spec.rb +++ b/spec/rackstash/message_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -11,7 +11,7 @@ require 'digest' require 'json' require 'rackstash/message' -describe Rackstash::Message do +RSpec.describe Rackstash::Message do let(:message_args) { {} } let(:msg) { 'message' } let(:message) { described_class.new msg, **message_args } diff --git a/spec/rackstash/rack/errors_spec.rb b/spec/rackstash/rack/errors_spec.rb index 7d84e19..555cc5b 100644 --- a/spec/rackstash/rack/errors_spec.rb +++ b/spec/rackstash/rack/errors_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/rack/errors' -describe Rackstash::Rack::Errors do +RSpec.describe Rackstash::Rack::Errors do let(:logger) { instance_double(Rackstash::Logger) } let(:errors) { described_class.new(logger) } diff --git a/spec/rackstash/rack/middleware_spec.rb b/spec/rackstash/rack/middleware_spec.rb index 128beea..75671a7 100644 --- a/spec/rackstash/rack/middleware_spec.rb +++ b/spec/rackstash/rack/middleware_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/rack/middleware' -describe Rackstash::Rack::Middleware do +RSpec.describe Rackstash::Rack::Middleware do let(:app) { lambda { |env| logger = env['rack.logger'] diff --git a/spec/rackstash/version_spec.rb b/spec/rackstash/version_spec.rb index 6e0e64b..58c390e 100644 --- a/spec/rackstash/version_spec.rb +++ b/spec/rackstash/version_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -9,7 +9,7 @@ require 'spec_helper' require 'rackstash/version' -describe 'Rackstash::Version' do +RSpec.describe 'Rackstash::Version' do it 'has a version number' do expect(Rackstash::Version::STRING).to be_a String expect(Rackstash::Version::STRING).to equal Rackstash::Version.to_s diff --git a/spec/rackstash_spec.rb b/spec/rackstash_spec.rb index 5a9beae..fc42734 100644 --- a/spec/rackstash_spec.rb +++ b/spec/rackstash_spec.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. require 'spec_helper' -describe Rackstash do +RSpec.describe Rackstash do describe Rackstash::NotImplementedHereError do it 'inherits from ScriptError' do expect(described_class.superclass).to equal ScriptError diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index adcdb1c..ee8ba43 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true # -# Copyright 2017 Holger Just +# Copyright 2017 - 2018 Holger Just # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. @@ -38,6 +38,9 @@ $LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'rackstash' RSpec.configure do |config| + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + config.mock_with :rspec do |mocks| # This option should be set when all dependencies are being loaded # before a spec run, as is the case in a typical spec helper. It will