Skip to content

Commit

Permalink
Fixed problem with all-matcher by using module_function
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Günnewig committed Aug 31, 2015
1 parent 4e69f33 commit 1939c40
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/aruba/api/deprecated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def touch_file(*args)
def mod?(file, perms, &block)
Aruba.platform.deprecated('The use of "#mod?" is deprecated. Use "expect().to have_permissions()" instead')

expect(Array(file)).to all_objects have_permissions(perms)
expect(Array(file)).to Aruba::Matchers.all have_permissions(perms)
end

# @deprecated
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/api/filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def with_file_content(file, &block)
# @result [FileSize]
# Bytes on disk
def disk_usage(*paths)
expect(paths.flatten).to all_objects be_an_existing_path
expect(paths.flatten).to Aruba::Matchers.all be_an_existing_path

Aruba.platform.determine_disk_usage paths.flatten.map { |p| ArubaPath.new(expand_path(p)) }, aruba.config.physical_block_size
end
Expand Down
4 changes: 2 additions & 2 deletions lib/aruba/cucumber/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
if negated
expect(files).not_to include an_existing_file
else
expect(files).to all_objects be_an_existing_file
expect(files).to Aruba::Matchers.all be_an_existing_file
end
end

Expand Down Expand Up @@ -126,7 +126,7 @@
if negated
expect(directories).not_to include an_existing_directory
else
expect(directories).to all_objects be_an_existing_directory
expect(directories).to Aruba::Matchers.all be_an_existing_directory
end
end

Expand Down
9 changes: 9 additions & 0 deletions lib/aruba/matchers/collection/all.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'rspec/expectations'

module Aruba
module Matchers
include ::RSpec::Matchers

module_function :all
end
end
2 changes: 0 additions & 2 deletions lib/aruba/matchers/collection/all_objects.rb

This file was deleted.

0 comments on commit 1939c40

Please sign in to comment.