Skip to content

Commit

Permalink
File.exists? => File.exist? (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomek-ac authored Apr 22, 2023
1 parent 8a3ba81 commit 55de262
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 55de262

Please sign in to comment.