2022-01-11 04:29:05 +00:00
|
|
|
require "../spec_helper"
|
|
|
|
|
2022-05-25 23:20:57 +00:00
|
|
|
Spectator.describe "Spec metadata", :smoke do
|
2022-01-11 04:29:05 +00:00
|
|
|
let(interpolation) { "string interpolation" }
|
|
|
|
|
|
|
|
it "supports #{interpolation}" do |example|
|
|
|
|
expect(example.name).to eq("supports string interpolation")
|
|
|
|
end
|
2022-01-11 04:49:54 +00:00
|
|
|
|
|
|
|
def self.various_strings
|
|
|
|
%w[foo bar baz]
|
|
|
|
end
|
|
|
|
|
|
|
|
sample various_strings do |string|
|
|
|
|
it "works with #{string}" do |example|
|
|
|
|
expect(example.name).to eq("works with #{string}")
|
|
|
|
end
|
|
|
|
end
|
2022-01-11 22:53:53 +00:00
|
|
|
|
|
|
|
def self.a_hash
|
|
|
|
{"foo" => 42, "bar" => 123, "baz" => 7}
|
|
|
|
end
|
|
|
|
|
|
|
|
sample a_hash do |key, value|
|
|
|
|
it "works with #{key} = #{value}" do |example|
|
|
|
|
expect(example.name).to eq("works with #{key} = #{value}")
|
|
|
|
end
|
|
|
|
end
|
2022-01-11 04:29:05 +00:00
|
|
|
end
|