Skip to content

Commit

Permalink
Switch to assert-style tests (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper authored Dec 17, 2024
1 parent 951291d commit b563e0e
Show file tree
Hide file tree
Showing 17 changed files with 537 additions and 401 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"

gemspec

gem "quickdraw", git: "https://github.com/joeldrapper/quickdraw.git"
gem "quickdraw", git: "https://github.com/joeldrapper/quickdraw.git", branch: "assert-style"
gem "benchmark-ips"

group :development do
Expand Down
File renamed without changes.
7 changes: 5 additions & 2 deletions lib/literal/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def insert(index, *value)
end

def inspect
@__value__.inspect
"Literal::Array(#{@__type__.inspect})#{@__value__.inspect}"
end

def intersect?(other)
Expand Down Expand Up @@ -497,6 +497,7 @@ def select(...)

def select!(...)
@__value__.select!(...)
self
end

def shift(...)
Expand Down Expand Up @@ -535,7 +536,9 @@ def to_a

alias_method :to_ary, :to_a

alias_method :to_s, :inspect
def to_s
@__value__.to_s
end

def uniq
__with__(@__value__.uniq)
Expand Down
7 changes: 7 additions & 0 deletions lib/literal/failure.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class Literal::Failure < Literal::Result
def initialize(error)
@error = error
end
end
4 changes: 4 additions & 0 deletions lib/literal/result.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class Listeral::Result
end
7 changes: 7 additions & 0 deletions lib/literal/success.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class Literal::Success < Literal::Result
def initialize(value)
@value = value
end
end
4 changes: 4 additions & 0 deletions lib/literal/tuple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ def initialize(values, types)
end

attr_reader :__values__, :__types__

def ==(other)
Literal::Tuple === other && @__values__ == other.__values__
end
end
Loading

0 comments on commit b563e0e

Please sign in to comment.