Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept nil/boolean for 1st column #20

Merged
merged 1 commit into from
Feb 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/rspec/parameterized/table_syntax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ module TableSyntax
refine Array do
include TableSyntaxImplement
end

refine NilClass do
include TableSyntaxImplement
end

refine TrueClass do
include TableSyntaxImplement
end

refine FalseClass do
include TableSyntaxImplement
end
end
end
end
14 changes: 14 additions & 0 deletions spec/parametarized_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,20 @@
end
end
end
context "when 1st column is nil or true or false" do
using RSpec::Parameterized::TableSyntax
where(:a, :result) do
nil | nil
false | false
true | true
end

with_them do
it "a is result" do
expect(a).to be result
end
end
end
end

context "when the where has let variables, defined by parent example group" do
Expand Down