mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
32 lines
866 B
Crystal
32 lines
866 B
Crystal
require "../../spec_helper"
|
|
|
|
# Examples taken from:
|
|
# https://relishapp.com/rspec/rspec-core/v/3-8/docs/subject/one-liner-syntax
|
|
# and modified to fit Spectator and Crystal.
|
|
Spectator.describe "One-liner syntax" do
|
|
context "Implicit subject" do
|
|
describe Array(Int32) do
|
|
# Rather than:
|
|
# it "should be empty" do
|
|
# subject.should be_empty
|
|
# end
|
|
|
|
# TODO: Define `should` method on example to be `is_expected`.
|
|
# it { should be_empty }
|
|
# or
|
|
it { is_expected.to be_empty }
|
|
end
|
|
end
|
|
|
|
context "Explicit subject" do
|
|
describe Array(Int32) do
|
|
describe "with 3 items" do
|
|
subject { [1, 2, 3] }
|
|
# TODO: Define `should_not` method on example to be `is_expected.not_to`.
|
|
# it { should_not be_empty }
|
|
# or
|
|
it { is_expected.not_to be_empty }
|
|
end
|
|
end
|
|
end
|
|
end
|