diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..9dd9947 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,15 @@ +version: 2.1 +orbs: + ruby: circleci/ruby@0.1.2 + +jobs: + build: + docker: + - image: circleci/ruby:2.6.3-stretch-node + executor: ruby/default + steps: + - checkout + - run: + name: Which bundler? + command: bundle -v + - ruby/bundle-install diff --git a/lib/nytimes.rb b/lib/nytimes.rb index 0708af4..1dd2cac 100644 --- a/lib/nytimes.rb +++ b/lib/nytimes.rb @@ -3443,4 +3443,7 @@ class Nytimes } ] } + + + end diff --git a/test/nytimes_test.rb b/test/nytimes_test.rb index 92804aa..cad21e8 100644 --- a/test/nytimes_test.rb +++ b/test/nytimes_test.rb @@ -13,12 +13,17 @@ def setup def test_it_can_get_copyright #Set your code to the local variable, "result" + result = @hash[:copyright] + +# binding.pry assert result, "Copyright (c) 2018 The New York Times Company. All Rights Reserved." end def test_it_can_get_array_of_stories #Set your code to the local variable, "result" + result = @hash[:results] + assert result.is_a? (Array) assert_equal 44, result.count end @@ -26,6 +31,9 @@ def test_it_can_get_array_of_stories def test_it_can_get_all_stories_with_subsection_of_politics #Set your code to the local variable, "result" + result = @hash[:results].select do |element| + element[:subsection] == "Politics" + end assert result.is_a? (Array) assert_equal 6, result.count