Skip to content

Commit

Permalink
Add Open3 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 8, 2022
1 parent b04d2b3 commit df4387d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
gem "bake-gem"
gem "bake-modernize"

gem "utopia-project"#, path: '../utopia-project'
gem "utopia-project"
end

# gem "async-rspec", path: "../async-rspec"
# gem "rspec-files", path: "../rspec-files"

gem "diffy"
25 changes: 25 additions & 0 deletions spec/diffy_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

require 'async'
require 'diffy'
require 'logger'

RSpec.describe Diffy do
def async_test_no_logfile
Async do
begin
100.times do
Diffy::Diff.new('hi there, how are?', 'hi there, how are you?').to_s(:html)
end
rescue => error
Console.logger.error(error)
pp error.backtrace
end
end
end

it "can log errors" do
10.times do
async_test_no_logfile
end
end
end
14 changes: 14 additions & 0 deletions spec/open3_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

require 'async'
require 'open3'
require 'logger'

RSpec.describe Open3 do
it "can log errors" do
2.times do
Sync do
Open3.popen3(["ls", "-lah"]) {|i, o, e| o.read}
end
end
end
end

0 comments on commit df4387d

Please sign in to comment.