Skip to content

Commit

Permalink
CI: Use stable version of Quickdraw (#742)
Browse files Browse the repository at this point in the history
But, also add a separate job that runs with edge version of Quickdraw.
Some tests were failing because they had no expectation (I added one),
and some were failing because they didn’t match the implementation (I
changed the tests to match).
  • Loading branch information
joeldrapper authored Jul 31, 2024
2 parents 82e4a49 + 1e71492 commit 27349e4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ jobs:
- name: Quickdraw Tests
run: bundle exec qt

test-edge-quickdraw:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: false

- name: Install dependencies
run: |
sed -e 's/gem "quickdraw".*/gem "quickdraw", github: "joeldrapper\/quickdraw"/' -i Gemfile
cat Gemfile
bundle config set --local without "development"
bundle install
- name: Quickdraw Tests
run: bundle exec qt

rubocop:
runs-on: "ubuntu-latest"
steps:
Expand All @@ -50,7 +71,9 @@ jobs:
bundler-cache: false

- name: Install dependencies
run: bundle install
run: |
bundle config set --local only "development"
bundle install
- name: Rubocop
run: bundle exec rubocop
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gemspec

group :test do
gem "sus"
gem "quickdraw", github: "joeldrapper/quickdraw"
gem "quickdraw", github: "joeldrapper/quickdraw", ref: "061b0fa9c6f10bc95190de2e1f2812fa52ff01a3"
gem "simplecov", require: false
if RUBY_ENGINE == "ruby" && RUBY_VERSION[0] > "3"
gem "async"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
include Phlex::Helpers

test "supports many bindings" do
output = grab({ class: "foo" }, { if: "bar" })
output = grab(class: "foo", if: "bar")
expect(output) == ["foo", "bar"]
end

test "supports single binding" do
output = grab({ class: "foo" })
expect(output) == ["foo"]
output = grab(class: "foo")
expect(output) == "foo"
end
9 changes: 4 additions & 5 deletions quickdraw/helpers/mix.test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
test "supports mixing between arrays and strings" do
output = mix({ class: ["foo"] }, { class: "bar" })

expect(output)
expect(output) == { class: ["foo", "bar"] }

output = mix({ class: "foo" }, { class: ["bar"] })

Expand All @@ -53,8 +53,7 @@
test "supports mixing between sets and strings" do
output = mix({ class: Set["foo"] }, { class: "bar" })

expect(output)
{ class: Set["foo", "bar"] }
expect(output) == { class: Set["foo", "bar"] }

output = mix({ class: "foo" }, { class: Set["bar"] })

Expand All @@ -64,7 +63,7 @@
test "supports mixing between arrays and sets, keeping the less restrictive type" do
output = mix({ class: ["foo"] }, { class: Set["bar"] })

expect(output)
expect(output) == { class: ["foo", "bar"] }

output = mix({ class: Set["foo"] }, { class: ["bar"] })

Expand All @@ -74,7 +73,7 @@
test "gracefully handles mixing with nils" do
output = mix({ class: "foo" }, { class: nil })

expect(output)
expect(output) == { class: "foo" }

output = mix({ class: nil }, { class: "foo" })

Expand Down

0 comments on commit 27349e4

Please sign in to comment.