Sha256: df8ac1557ddaf5d8c8ecb62292d1e15a17fd98fdabe6f553485c4065043470e5
Contents?: true
Size: 882 Bytes
Versions: 24
Compression:
Stored size: 882 Bytes
Contents
RSpec.describe "EitilCore Kernel#args_to_ivars!" do it "should set the given positional arguments to instance variables" do def test_method(a, b, c) args_to_ivars! :a, :c end test_method(1, "two", :three) expect(@a).to eq 1 expect(@b).to be_nil expect(@c).to eq :three expect(@d).to be_nil end it "should set the given keyword arguments to instance variables" do def test_method(a:, b:, c:) args_to_ivars! :a, :c end test_method(a: 1, b: "two", c: :three) expect(@a).to eq 1 expect(@b).to be_nil expect(@c).to eq :three expect(@d).to be_nil end it "should set the given local variables to instance variables" do a = 1 b = "two" c = :three args_to_ivars! :a, :c expect(@a).to eq 1 expect(@b).to be_nil expect(@c).to eq :three expect(@d).to be_nil end end
Version data entries
24 entries across 24 versions & 1 rubygems