Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Aug 31, 2024
1 parent 2c63f35 commit 7f9bdce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/quickdraw/expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class Quickdraw::Expectation
include Quickdraw::Matchers::ToReceive

def initialize(context, subject = Quickdraw::Null, &block)
if block && Quickdraw::Null != subject
raise Quickdraw::ArgumentError.new("You must only provide a subject or a block to `expect`.")
if block
if Quickdraw::Null != subject
raise Quickdraw::ArgumentError.new("You must only provide a subject or a block to `expect`.")
end
elsif Quickdraw::Null == subject
raise Quickdraw::ArgumentError.new("You must provide a subject or a block to `expect`.")
end

@context = context
Expand Down
4 changes: 3 additions & 1 deletion lib/quickdraw/never.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def initialize(message)
end

def method_missing(method_name, ...)
::Kernel.raise ::ArgumentError.new(@message)
::Kernel.raise(
::ArgumentError.new(@message),
)
end
end

0 comments on commit 7f9bdce

Please sign in to comment.