Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
support ruby32 syntax
  • Loading branch information
nicolaa committed Jan 13, 2023
commit f9e78b5a63650544d95b211ba9706038682b8227
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/append_json_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion spec/api_documentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/writers/html_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/json_iodocs_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/writers/json_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/writers/markdown_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/slate_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/textile_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down