diff --git a/lib/rspec_api_documentation/writers/append_json_writer.rb b/lib/rspec_api_documentation/writers/append_json_writer.rb index 5eae1f7b..69f943e7 100644 --- a/lib/rspec_api_documentation/writers/append_json_writer.rb +++ b/lib/rspec_api_documentation/writers/append_json_writer.rb @@ -5,7 +5,7 @@ module Writers class AppendJsonWriter < JsonWriter def write index_file = docs_dir.join("index.json") - if File.exists?(index_file) && (output = File.read(index_file)).length >= 2 + if File.exist?(index_file) && (output = File.read(index_file)).length >= 2 existing_index_hash = JSON.parse(output) end File.open(index_file, "w+") do |f| diff --git a/lib/rspec_api_documentation/writers/writer.rb b/lib/rspec_api_documentation/writers/writer.rb index d70b1f2a..a00c1715 100644 --- a/lib/rspec_api_documentation/writers/writer.rb +++ b/lib/rspec_api_documentation/writers/writer.rb @@ -14,7 +14,7 @@ def self.write(index, configuration) end def self.clear_docs(docs_dir) - if File.exists?(docs_dir) + if File.exist?(docs_dir) FileUtils.rm_rf(docs_dir, :secure => true) end FileUtils.mkdir_p(docs_dir) diff --git a/spec/api_documentation_spec.rb b/spec/api_documentation_spec.rb index 39930cc4..dc295567 100644 --- a/spec/api_documentation_spec.rb +++ b/spec/api_documentation_spec.rb @@ -19,7 +19,7 @@ subject.clear_docs expect(File.directory?(configuration.docs_dir)).to be_truthy - expect(File.exists?(test_file)).to be_falsey + expect(File.exist?(test_file)).to be_falsey end end diff --git a/spec/writers/html_writer_spec.rb b/spec/writers/html_writer_spec.rb index 72dc5615..76db414e 100644 --- a/spec/writers/html_writer_spec.rb +++ b/spec/writers/html_writer_spec.rb @@ -27,7 +27,7 @@ writer.write index_file = File.join(configuration.docs_dir, "index.html") - expect(File.exists?(index_file)).to be_truthy + expect(File.exist?(index_file)).to be_truthy end end end diff --git a/spec/writers/json_iodocs_writer_spec.rb b/spec/writers/json_iodocs_writer_spec.rb index bfee639c..116ccab1 100644 --- a/spec/writers/json_iodocs_writer_spec.rb +++ b/spec/writers/json_iodocs_writer_spec.rb @@ -25,7 +25,7 @@ it "should write the index" do writer.write index_file = File.join(configuration.docs_dir, "apiconfig.json") - expect(File.exists?(index_file)).to be_truthy + expect(File.exist?(index_file)).to be_truthy end end end diff --git a/spec/writers/json_writer_spec.rb b/spec/writers/json_writer_spec.rb index 9e5e6b8d..973b52b1 100644 --- a/spec/writers/json_writer_spec.rb +++ b/spec/writers/json_writer_spec.rb @@ -24,7 +24,7 @@ it "should write the index" do writer.write index_file = File.join(configuration.docs_dir, "index.json") - expect(File.exists?(index_file)).to be_truthy + expect(File.exist?(index_file)).to be_truthy end end end diff --git a/spec/writers/markdown_writer_spec.rb b/spec/writers/markdown_writer_spec.rb index 799336ee..313a51d9 100644 --- a/spec/writers/markdown_writer_spec.rb +++ b/spec/writers/markdown_writer_spec.rb @@ -27,7 +27,7 @@ writer.write index_file = File.join(configuration.docs_dir, "index.md") - expect(File.exists?(index_file)).to be_truthy + expect(File.exist?(index_file)).to be_truthy end end end diff --git a/spec/writers/slate_writer_spec.rb b/spec/writers/slate_writer_spec.rb index 9c1398da..acd91047 100644 --- a/spec/writers/slate_writer_spec.rb +++ b/spec/writers/slate_writer_spec.rb @@ -27,7 +27,7 @@ writer.write index_file = File.join(configuration.docs_dir, "index.html.md") - expect(File.exists?(index_file)).to be_truthy + expect(File.exist?(index_file)).to be_truthy end end end diff --git a/spec/writers/textile_writer_spec.rb b/spec/writers/textile_writer_spec.rb index 1531f7ad..2e10cb7d 100644 --- a/spec/writers/textile_writer_spec.rb +++ b/spec/writers/textile_writer_spec.rb @@ -27,7 +27,7 @@ writer.write index_file = File.join(configuration.docs_dir, "index.textile") - expect(File.exists?(index_file)).to be_truthy + expect(File.exist?(index_file)).to be_truthy end end end