Skip to content

Commit

Permalink
Clearly a module isn't the way to go...
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrasimplicity committed Mar 21, 2018
1 parent 69e89bd commit f6f3137
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions lib/aruba/matchers/file/have_same_file_content.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'rspec/expectations/version'
require 'fileutils'
require 'rspec/core' unless defined? RSpec.configure

# @!method have_same_file_content_as(file_name)
# This matchers checks if <file1> has the same content like <file2>
Expand Down Expand Up @@ -46,20 +45,14 @@
RSpec::Matchers.alias_matcher :a_file_with_same_content_as, :have_same_file_content_as

# Deprecated matchers
module DeprecatedMatchers
def have_same_file_content_like(expected)
RSpec.deprecate('`have_same_file_content_like`', replacement: '`have_same_file_content_as`')
def have_same_file_content_like(expected)
RSpec.deprecate('`have_same_file_content_like`', replacement: '`have_same_file_content_as`')

have_same_file_content_as(expected)
end

def a_file_with_same_content_like(expected)
RSpec.deprecate('`a_file_with_same_content_like`', replacement: '`a_file_with_same_content_as`')

a_file_with_same_content_as(expected)
end
have_same_file_content_as(expected)
end

RSpec.configure do |config|
config.include DeprecatedMatchers
end
def a_file_with_same_content_like(expected)
RSpec.deprecate('`a_file_with_same_content_like`', replacement: '`a_file_with_same_content_as`')

a_file_with_same_content_as(expected)
end

0 comments on commit f6f3137

Please sign in to comment.