load("@rules_ruby//ruby:defs.bzl", "rb_library")
load("//rb/spec:tests.bzl", "rb_unit_test")

rb_library(
    name = "spec_helper",
    testonly = True,
    srcs = ["spec_helper.rb"],
    visibility = ["//rb/spec:__subpackages__"],
    deps = [
        "//rb/lib:selenium-webdriver",
        "//rb/lib/selenium:webdriver",
        "//rb/lib/selenium/webdriver:atoms",
        "//rb/spec:rspec_matchers",
        "@bundle",
    ],
)

rb_unit_test(
    name = "search_context",
    srcs = ["search_context_spec.rb"],
    deps = [
        "//rb/lib/selenium/webdriver:common",
        "//rb/lib/selenium/webdriver:remote",
    ],
)

[
    rb_unit_test(
        name = file[:-8],
        srcs = [file],
        deps = ["//rb/lib/selenium/webdriver:common"],
    )
    for file in glob(
        ["*_spec.rb"],
        exclude = ["search_context_spec.rb"],
    )
]
