Skip to content

Commit

Permalink
Event::Failure: add #exception
Browse files Browse the repository at this point in the history
  • Loading branch information
paddor authored and ioquatix committed Jul 18, 2024
1 parent f9d14d2 commit 3016755
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/console/event/failure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def self.for(exception)
def self.log(subject, exception, **options)
Console.error(subject, **self.for(exception).to_hash, **options)
end


attr_reader :exception

def initialize(exception, root = Dir.getwd)
@exception = exception
@root = root
Expand Down
6 changes: 6 additions & 0 deletions test/console/event/failure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,11 @@ def detailed_message(...)
)
)
end

it "can get #exception" do
failure = Console::Event::Failure.for(error)

expect(failure.exception).to be == error
end
end
end

0 comments on commit 3016755

Please sign in to comment.