From 512f627f64cef96419be8972aa641f01b811651f Mon Sep 17 00:00:00 2001 From: Erik Thiem Date: Thu, 18 May 2017 12:55:26 -0400 Subject: [PATCH 1/2] Testing to see if I setup github ssh auth correctly --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..fcf6d46 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +testing github From e278536dedecd83afe70ce72ad4e5bba8a5fbcfc Mon Sep 17 00:00:00 2001 From: Erik Thiem Date: Thu, 18 May 2017 13:29:54 -0400 Subject: [PATCH 2/2] Updated values to pass tests --- spec/refresher_spec.rb | 36 ++++++++++++++++++------------------ test.txt | 1 - 2 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 test.txt diff --git a/spec/refresher_spec.rb b/spec/refresher_spec.rb index 3766252..b8cb34c 100644 --- a/spec/refresher_spec.rb +++ b/spec/refresher_spec.rb @@ -5,70 +5,70 @@ context "guess the collection" do it "Yes, it is a Object, but which class" do - expect([].is_a? _fill_in_object_).to be true - expect(Array.new.instance_of? _FILL_ME_IN_).to be true + expect([].is_a? Array).to be true + expect(Array.new.instance_of? Array).to be true end it "Yes, it is a Object, but which class" do - expect({}.is_a? _fill_in_object_).to be true - expect(Hash.new.instance_of? _FILL_ME_IN_).to be true + expect({}.is_a? Hash).to be true + expect(Hash.new.instance_of? Hash).to be true end end context "guess the type" do it "Yes, it is a Object, but which" do - expect(:class.is_a? _fill_in_object_).to be true + expect(:class.is_a? Symbol).to be true end it "Yes, it is a Object, but which" do - expect("module".is_a? _fill_in_object_).to be true + expect("module".is_a? String).to be true end it "Yes, it is a Object, but which" do - expect(1.is_a? _fill_in_object_).to be true + expect(1.is_a? Fixnum).to be true end it "Yes, it is a Object, but which" do - expect(1.5.is_a? _fill_in_object_).to be true + expect(1.5.is_a? Float).to be true end end context "the following are Array methods" do it "adds a thing to the end of the method" do - expect([]._fill_in_method_here_(1)).to eq [1] + expect([].push(1)).to eq [1] end it "removes an item from the end of an array" do - expect([1]._fill_in_method_here_).to eq 1 + expect([1].pop()).to eq 1 end it "adds an item to the front of an array" do - expect([1]._fill_in_method_here_("banana")).to eq ["banana", 1] + expect([1].unshift("banana")).to eq ["banana", 1] end it "removes an item from the front of an array" do - expect([1, "banana"]._fill_in_method_here_).to eq 1 + expect([1, "banana"].shift()).to eq 1 end end context "the following are Hash methods" do it "adds a key and value to a Hash" do a_hash = {} - fail "remove this entire line, implement your solution here" + a_hash["newVal"] = 1 expect(a_hash.empty?).to be false end it "returns a value from the hash for the given key" do a_hash = {magic: :johnson, shirley: :temple, "babe" => "ruth"} - expect(a_hash.fetch(:magic)).to eq _fill_in_sym_or_str - expect(a_hash[:shirley]).to eq _fill_in_sym_or_str - expect(a_hash["babe"]).to eq _fill_in_sym_or_str + expect(a_hash.fetch(:magic)).to eq :johnson + expect(a_hash[:shirley]).to eq :temple + expect(a_hash["babe"]).to eq "ruth" end it "removes a key value pair from a hash" do a_hash = { frank: :sinatra } - a_hash._fill_in_method_here_(:frank) + a_hash.delete(:frank) expect(a_hash.empty?).to be true end end @@ -76,7 +76,7 @@ context "on loops, yeah!!!" do it "should loop over the array and return a new array" do loopy = [1,2,3] - expect(loopy._fill_in_method_here_ { |n| n + 1 }).to eq [2,3,4] + expect(loopy.map { |n| n + 1 }).to eq [2,3,4] end end diff --git a/test.txt b/test.txt deleted file mode 100644 index fcf6d46..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -testing github