spec/parametarized_spec.rb in rspec-parameterized-0.2.0 vs spec/parametarized_spec.rb in rspec-parameterized-0.3.0
- old
+ new
@@ -24,10 +24,16 @@
it "should do additions" do
expect(a + b).to eq answer
end
end
+ with_them do
+ it "#{params[:a]} + #{params[:b]} == #{params[:answer]}" do
+ expect(a + b).to eq answer
+ end
+ end
+
with_them pending: "PENDING" do
it "should do additions" do
expect(a + b).to == answer
end
end
@@ -58,24 +64,10 @@
expect(a + b + c).to be_even
end
end
end
- describe "table separated with pipe" do
- where_table(:a, :b, :answer) do
- 1 | 2 | 3
- "hello " | "world" | "hello world"
- [1, 2, 3] | [4, 5, 6] | [1, 2, 3, 4, 5, 6]
- end
-
- with_them do
- it "a plus b is answer" do
- expect(a + b).to eq answer
- end
- end
- end
-
if RUBY_VERSION >= "2.1"
describe "table separated with pipe (using TableSyntax)" do
using RSpec::Parameterized::TableSyntax
where(:a, :b, :answer) do
@@ -160,22 +152,10 @@
expect(x).to eq x
end
end
end
- context "when the table has only a row" do
- where_table(:a, :b, :answer) do
- 1 | 2 | 3
- end
-
- with_them do
- it "a plus b is answer" do
- expect(a + b).to eq answer
- end
- end
- end
-
if RUBY_VERSION >= "2.1"
context "when the table has only a row (using TableSyntax)" do
using RSpec::Parameterized::TableSyntax
where(:a, :b, :answer) do
@@ -213,22 +193,9 @@
where(:a, :b, :answer) do
[
[1 , 2 , 3],
[five , eight , 13],
]
- end
-
- with_them do
- it "a plus b is answer" do
- expect(a + b).to eq answer
- end
- end
- end
-
- describe "child 2 (where_table)" do
- where_table(:a, :b, :answer) do
- 1 | 2 | 3
- five | eight | 13
end
with_them do
it "a plus b is answer" do
expect(a + b).to eq answer