Skip to content

Commit ff9ccec

Browse files
committed
WIP Fix failing tests
1 parent 8cfe769 commit ff9ccec

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

spec/tapioca/cli/dsl_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,7 @@ def self.gather_constants
17601760

17611761
it "generates RBIs for lower versions of activerecord-typedstore" do
17621762
@project.require_real_gem("activerecord-typedstore", "1.4.0")
1763-
@project.require_real_gem("sqlite3", "1.7.3")
1763+
@project.require_real_gem("sqlite3", "~> 2.1")
17641764
@project.bundle_install!
17651765
@project.write!("lib/post.rb", <<~RB)
17661766
require "active_record"
@@ -2206,7 +2206,7 @@ class Tapioca::Dsl::Compilers::ActiveRecordRelations
22062206

22072207
@project.require_mock_gem(foo)
22082208
@project.require_real_gem("activerecord", require: "active_record")
2209-
@project.require_real_gem("sqlite3", "1.7.3")
2209+
@project.require_real_gem("sqlite3", "~> 2.1")
22102210
@project.bundle_install!
22112211

22122212
result = @project.tapioca("dsl Post")
@@ -3018,7 +3018,7 @@ class Application < Rails::Application
30183018
describe "options for built-in compilers" do
30193019
it "is able to pass 'untyped' to ActiveRecordColumns compiler" do
30203020
@project.require_real_gem("activerecord")
3021-
@project.require_real_gem("sqlite3", "1.7.3")
3021+
@project.require_real_gem("sqlite3", "~> 2.1")
30223022
@project.bundle_install!
30233023
@project.write!("lib/post.rb", <<~RB)
30243024
require "active_record"

spec/tapioca/cli/gem_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,12 @@ class Post
12571257

12581258
res = @project.tapioca("gem foo")
12591259

1260+
expected_callbacks = if RUBY_VERSION >= "3.2"
1261+
"def __callbacks; end\n def __callbacks=(new_value); end"
1262+
else
1263+
"def __callbacks; end"
1264+
end
1265+
12601266
assert_project_file_equal("sorbet/rbi/gems/[email protected]", <<~RBI)
12611267
# typed: true
12621268
@@ -1269,7 +1275,7 @@ module Foo; end
12691275
12701276
class Foo::Engine < ::Rails::Engine
12711277
class << self
1272-
def __callbacks; end
1278+
#{expected_callbacks}
12731279
end
12741280
end
12751281
@@ -1281,7 +1287,7 @@ class User; end
12811287
end
12821288

12831289
it "does not crash while tracking `rbtrace` constants" do
1284-
@project.require_real_gem("rbtrace", "0.4.14")
1290+
@project.require_real_gem("rbtrace", "0.5.1")
12851291
@project.bundle_install!
12861292
result = @project.tapioca("gem rbtrace")
12871293
assert_empty_stderr(result)

0 commit comments

Comments
 (0)