Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix File.exists? deprecation #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/state_machine/integrations/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def version(name, &block)
# support i18n.
def locale_path
path = "#{File.dirname(__FILE__)}/#{integration_name}/locale.rb"
path if File.exists?(path)
path if File.exist?(path)
end

# Extends the given object with any version overrides that are currently
Expand Down
8 changes: 4 additions & 4 deletions test/unit/machine_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3229,26 +3229,26 @@ def test_should_raise_exception_if_invalid_option_specified

def test_should_save_file_with_class_name_by_default
@machine.draw
assert File.exists?("./#{@klass.name}_state.png")
assert File.exist?("./#{@klass.name}_state.png")
end

def test_should_allow_base_name_to_be_customized
name = "machine_#{rand(1000000)}"
@machine.draw(:name => name)
@path = "./#{name}.png"
assert File.exists?(@path)
assert File.exist?(@path)
end

def test_should_allow_format_to_be_customized
@machine.draw(:format => 'jpg')
@path = "./#{@klass.name}_state.jpg"
assert File.exists?(@path)
assert File.exist?(@path)
end

def test_should_allow_path_to_be_customized
@machine.draw(:path => "#{File.dirname(__FILE__)}/")
@path = "#{File.dirname(__FILE__)}/#{@klass.name}_state.png"
assert File.exists?(@path)
assert File.exist?(@path)
end

def test_should_allow_orientation_to_be_landscape
Expand Down