{"action":"created","comment":{"url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/comments/121495269","pull_request_review_id":43528298,"id":121495269,"diff_hunk":"@@ -0,0 +1,95 @@\n+require \"spec_helper\"\n+\n+describe \"MusicImporter\" do\n+  let(:music_importer) { MusicImporter.new(\"./spec/fixtures/mp3s\") }\n+\n+  describe \"#initialize\" do\n+    it \"accepts a file path to parse MP3 files from\" do\n+      expect(music_importer.instance_variable_defined?(:@path)).to be(true)\n+      expect(music_importer.instance_variable_get(:@path)).to eq(\"./spec/fixtures/mp3s\")\n+    end\n+  end\n+\n+  describe \"#path\" do\n+    it \"retrieves the path provided to the MusicImporter object\" do\n+      expect(music_importer.path).to eq(\"./spec/fixtures/mp3s\")\n+    end\n+  end\n+\n+  describe \"#files\" do\n+    it \"loads all the MP3 files in the path directory\" do\n+      expect(music_importer.files.size).to eq(4)\n+    end\n+\n+    it \"normalizes the filename to just the MP3 filename with no path\" do\n+      expect(music_importer.files).to include(\"Action Bronson - Larry Csonka - indie.mp3\")\n+      expect(music_importer.files).to include(\"Real Estate - Green Aisles - country.mp3\")\n+      expect(music_importer.files).to include(\"Real Estate - It's Real - hip-hop.mp3\")\n+      expect(music_importer.files).to include(\"Thundercat - For Love I Come - dance.mp3\")\n+    end\n+  end\n+end\n+\n+describe \"Song\" do\n+  describe \".new_from_filename\" do\n+    it \"initializes a song based on the passed-in filename\" do\n+      song = Song.new_from_filename(\"Thundercat - For Love I Come - dance.mp3\")\n+\n+      expect(song.name).to eq(\"For Love I Come\")\n+      expect(song.artist.name).to eq(\"Thundercat\")\n+      expect(song.genre.name).to eq(\"dance\")\n+    end\n+\n+    it \"invokes the appropriate Findable methods so as to avoid duplicating objects\" do\n+      artist = Artist.create(\"Thundercat\")\n+      genre = Genre.create(\"dance\")\n+\n+      expect(Artist).to receive(:find_or_create_by_name).and_return(artist)\n+      expect(Genre).to receive(:find_or_create_by_name).and_return(genre)\n+\n+      song = Song.new_from_filename(\"Thundercat - For Love I Come - dance.mp3\")\n+\n+      expect(song.artist).to be(artist)\n+      expect(song.genre).to be(genre)\n+    end\n+  end\n+\n+  describe \".create_from_filename\" do\n+    it \"initializes and saves a song based on the passed-in filename\" do\n+      song = Song.create_from_filename(\"Thundercat - For Love I Come - dance.mp3\")\n+\n+      expect(Song.all.last.genre.name).to eq(\"dance\")\n+    end\n+\n+    it \"invokes .new_from_filename instead of re-coding the same functionality\" do\n+      expect(Song).to receive(:new_from_filename).and_return(double(save: true))\n+\n+      Song.create_from_filename(\"Thundercat - For Love I Come - dance.mp3\")\n+    end\n+  end\n+end\n+\n+describe \"MusicImporter\" do\n+  describe \"#import\" do\n+    let(:music_importer) { MusicImporter.new(\"./spec/fixtures/mp3s\") }\n+\n+    it \"imports the files into the library by invoking Song.create_from_filename\" do\n+      expect(Song).to receive(:create_from_filename).with(\"Action Bronson - Larry Csonka - indie.mp3\")\n+      expect(Song).to receive(:create_from_filename).with(\"Real Estate - Green Aisles - country.mp3\")\n+      expect(Song).to receive(:create_from_filename).with(\"Real Estate - It's Real - hip-hop.mp3\")\n+      expect(Song).to receive(:create_from_filename).with(\"Thundercat - For Love I Come - dance.mp3\")\n+\n+      music_importer.import\n+    end\n+\n+    it \"sorts the files alphabetically prior to creating new songs from the filenames\" do","path":"spec/009_music_importer_spec.rb","position":null,"original_position":85,"commit_id":"cf83bf81c3752dfc0064f4f65c05fc8d8ba9c78e","original_commit_id":"99110bfd181b7da8746095478a5c309644edcc03","user":{"login":"gj","id":17556281,"avatar_url":"https://avatars3.githubusercontent.com/u/17556281?v=3","gravatar_id":"","url":"https://api.github.com/users/gj","html_url":"https://github.com/gj","followers_url":"https://api.github.com/users/gj/followers","following_url":"https://api.github.com/users/gj/following{/other_user}","gists_url":"https://api.github.com/users/gj/gists{/gist_id}","starred_url":"https://api.github.com/users/gj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gj/subscriptions","organizations_url":"https://api.github.com/users/gj/orgs","repos_url":"https://api.github.com/users/gj/repos","events_url":"https://api.github.com/users/gj/events{/privacy}","received_events_url":"https://api.github.com/users/gj/received_events","type":"User","site_admin":false},"body":"You right you right. Fixed: cf83bf8","created_at":"2017-06-12T18:47:22Z","updated_at":"2017-06-12T18:47:22Z","html_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli/pull/36#discussion_r121495269","pull_request_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/comments/121495269"},"html":{"href":"https://github.com/learn-co-curriculum/ruby-music-library-cli/pull/36#discussion_r121495269"},"pull_request":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36","id":124787726,"html_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli/pull/36","diff_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli/pull/36.diff","patch_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli/pull/36.patch","issue_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/36","number":36,"state":"open","locked":false,"title":"Overhaul lesson + test suite","user":{"login":"gj","id":17556281,"avatar_url":"https://avatars3.githubusercontent.com/u/17556281?v=3","gravatar_id":"","url":"https://api.github.com/users/gj","html_url":"https://github.com/gj","followers_url":"https://api.github.com/users/gj/followers","following_url":"https://api.github.com/users/gj/following{/other_user}","gists_url":"https://api.github.com/users/gj/gists{/gist_id}","starred_url":"https://api.github.com/users/gj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gj/subscriptions","organizations_url":"https://api.github.com/users/gj/orgs","repos_url":"https://api.github.com/users/gj/repos","events_url":"https://api.github.com/users/gj/events{/privacy}","received_events_url":"https://api.github.com/users/gj/received_events","type":"User","site_admin":false},"body":"Fixes #33 \r\nFixes #32 \r\nFixes #30 \r\nFixes #29 \r\nFixes #25 \r\nFixes #24 \r\nFixes #23 \r\n\r\nCloses #34 \r\nCloses #28 \r\nCloses #27 \r\n","created_at":"2017-06-09T04:05:24Z","updated_at":"2017-06-12T18:47:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d08e052b8e67b0ae04978e072cac1331641b30db","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36/commits","review_comments_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36/comments","review_comment_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/36/comments","statuses_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/statuses/cf83bf81c3752dfc0064f4f65c05fc8d8ba9c78e","head":{"label":"learn-co-curriculum:wip-master","ref":"wip-master","sha":"cf83bf81c3752dfc0064f4f65c05fc8d8ba9c78e","user":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars2.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"repo":{"id":45212977,"name":"ruby-music-library-cli","full_name":"learn-co-curriculum/ruby-music-library-cli","owner":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars2.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli","description":null,"fork":false,"url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli","forks_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/forks","keys_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/teams","hooks_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/hooks","issue_events_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/events{/number}","events_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/events","assignees_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/assignees{/user}","branches_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/branches{/branch}","tags_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/tags","blobs_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/languages","stargazers_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/stargazers","contributors_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/contributors","subscribers_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/subscribers","subscription_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/subscription","commits_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/contents/{+path}","compare_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/merges","archive_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/downloads","issues_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues{/number}","pulls_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/labels{/name}","releases_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/releases{/id}","deployments_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/deployments","created_at":"2015-10-29T21:56:08Z","updated_at":"2017-05-13T22:59:07Z","pushed_at":"2017-06-12T18:46:54Z","git_url":"git://github.com/learn-co-curriculum/ruby-music-library-cli.git","ssh_url":"git@github.com:learn-co-curriculum/ruby-music-library-cli.git","clone_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli.git","svn_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli","homepage":null,"size":70,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":12,"forks":16,"open_issues":12,"watchers":1,"default_branch":"master"}},"base":{"label":"learn-co-curriculum:master","ref":"master","sha":"601aad05d153acc33dd00700ed225e5ec35fdc60","user":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars2.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"repo":{"id":45212977,"name":"ruby-music-library-cli","full_name":"learn-co-curriculum/ruby-music-library-cli","owner":{"login":"learn-co-curriculum","id":6208017,"avatar_url":"https://avatars2.githubusercontent.com/u/6208017?v=3","gravatar_id":"","url":"https://api.github.com/users/learn-co-curriculum","html_url":"https://github.com/learn-co-curriculum","followers_url":"https://api.github.com/users/learn-co-curriculum/followers","following_url":"https://api.github.com/users/learn-co-curriculum/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-curriculum/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-curriculum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-curriculum/subscriptions","organizations_url":"https://api.github.com/users/learn-co-curriculum/orgs","repos_url":"https://api.github.com/users/learn-co-curriculum/repos","events_url":"https://api.github.com/users/learn-co-curriculum/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-curriculum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli","description":null,"fork":false,"url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli","forks_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/forks","keys_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/teams","hooks_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/hooks","issue_events_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/events{/number}","events_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/events","assignees_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/assignees{/user}","branches_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/branches{/branch}","tags_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/tags","blobs_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/languages","stargazers_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/stargazers","contributors_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/contributors","subscribers_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/subscribers","subscription_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/subscription","commits_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/contents/{+path}","compare_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/merges","archive_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/downloads","issues_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues{/number}","pulls_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/labels{/name}","releases_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/releases{/id}","deployments_url":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/deployments","created_at":"2015-10-29T21:56:08Z","updated_at":"2017-05-13T22:59:07Z","pushed_at":"2017-06-12T18:46:54Z","git_url":"git://github.com/learn-co-curriculum/ruby-music-library-cli.git","ssh_url":"git@github.com:learn-co-curriculum/ruby-music-library-cli.git","clone_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli.git","svn_url":"https://github.com/learn-co-curriculum/ruby-music-library-cli","homepage":null,"size":70,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":12,"forks":16,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36"},"html":{"href":"https://github.com/learn-co-curriculum/ruby-music-library-cli/pull/36"},"issue":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/36"},"comments":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/learn-co-curriculum/ruby-music-library-cli/statuses/cf83bf81c3752dfc0064f4f65c05fc8d8ba9c78e"}}}}
{"actor":{"display_login":"gj"}}