{"action":"created","comment":{"url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/comments/50830862","id":50830862,"diff_hunk":"@@ -0,0 +1,62 @@\n+#!/usr/bin/env rspec\n+require_relative '../src/modules/IscsiClientLib'\n+\n+describe Yast::IscsiClientLibClass do\n+\n+  before :each do\n+    @iscsilib = Yast::IscsiClientLibClass.new\n+    @iscsilib.main() \n+  end\n+\n+  describe \"#getiBFT\" do\n+    context \"when filtering output of 'iscsiadm -m fw'\" do\n+      it \"returns data in form of a map \" do\n+        @iscsilib.stub(:getFirmwareInfo).\n+          and_return(\"# BEGIN RECORD 2.0-872\\n\"\\\n+                     \"# END RECORD\\n\"\\\n+                     \"iface.bootproto = STATIC\\n\"\\\n+                     \"iface.hwaddress = 00:00:c9:b1:bc:7f\\n\"\\\n+                     \"iface.initiatorname = iqn.2011-05.com.emulex:eraptorrfshoneport1\\n\"\\\n+                     \"node.conn[0].address = 172.0.21.6\\n\"\\\n+                     \"node.conn[0].port = 3260\\n\"\\\n+                     \"node.name = iqn.1986-03.com.ibm:sn.135061874\\n\"\n+                     )\n+\n+        ibft_data = @iscsilib.getiBFT()\n+\n+        expect(ibft_data).to eq(\n+                                {\"# BEGIN RECORD 2.0-872\" => \"\", \n+                                  \"# END RECORD\" => \"\", \n+                                  \"iface.bootproto\" => \"STATIC\", \n+                                  \"iface.hwaddress\" => \"00:00:c9:b1:bc:7f\", \n+                                  \"iface.initiatorname\" => \"iqn.2011-05.com.emulex:eraptorrfshoneport1\", \n+                                  \"node.conn[0].address\" => \"172.0.21.6\", \n+                                  \"node.conn[0].port\" => \"3260\", \n+                                  \"node.name\" => \"iqn.1986-03.com.ibm:sn.135061874\"})\n+      end\n+    end\n+\n+    context \"when could not get list of targets from firmware\" do\n+      it \"returns an empty map \" do\n+        @iscsilib.stub(:getFirmwareInfo).\n+          and_return(\"\")\n+\n+        ibft_data = @iscsilib.getiBFT()\n+         \n+        expect(ibft_data).to eq({})\n+      end\n+    end\n+\n+    context \"when not on x86 hardware\" do\n+      it \"returns an empty map \" do\n+        Yast::Arch.stub(:x86_64).and_return(false)\n+        Yast::Arch.stub(:i386).and_return(false)      ","path":"test/getiBFT_spec.rb","position":53,"original_position":53,"commit_id":"ef504240adabe260a42cf76cfd6d43228cb191ee","original_commit_id":"ef504240adabe260a42cf76cfd6d43228cb191ee","user":{"login":"jreidinger","id":478871,"avatar_url":"https://avatars.githubusercontent.com/u/478871?v=3","gravatar_id":"","url":"https://api.github.com/users/jreidinger","html_url":"https://github.com/jreidinger","followers_url":"https://api.github.com/users/jreidinger/followers","following_url":"https://api.github.com/users/jreidinger/following{/other_user}","gists_url":"https://api.github.com/users/jreidinger/gists{/gist_id}","starred_url":"https://api.github.com/users/jreidinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreidinger/subscriptions","organizations_url":"https://api.github.com/users/jreidinger/orgs","repos_url":"https://api.github.com/users/jreidinger/repos","events_url":"https://api.github.com/users/jreidinger/events{/privacy}","received_events_url":"https://api.github.com/users/jreidinger/received_events","type":"User","site_admin":false},"body":"two notes:\r\n\r\n1) please see that above it is not stubbed, that test is on x86_64, so build for ppc or s390 fails as other contexts return empty map\r\n2) I prefer to stub `Yast::Arch.architecture` method. It is one liner and more explicit which architecture is simulated.","created_at":"2016-01-26T12:56:24Z","updated_at":"2016-01-26T12:56:24Z","html_url":"https://github.com/yast/yast-iscsi-client/pull/48#discussion_r50830862","pull_request_url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/comments/50830862"},"html":{"href":"https://github.com/yast/yast-iscsi-client/pull/48#discussion_r50830862"},"pull_request":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48","id":57204658,"html_url":"https://github.com/yast/yast-iscsi-client/pull/48","diff_url":"https://github.com/yast/yast-iscsi-client/pull/48.diff","patch_url":"https://github.com/yast/yast-iscsi-client/pull/48.patch","issue_url":"https://api.github.com/repos/yast/yast-iscsi-client/issues/48","number":48,"state":"open","locked":false,"title":"refactoring of getiBFT, test added","user":{"login":"gabi2","id":1658828,"avatar_url":"https://avatars.githubusercontent.com/u/1658828?v=3","gravatar_id":"","url":"https://api.github.com/users/gabi2","html_url":"https://github.com/gabi2","followers_url":"https://api.github.com/users/gabi2/followers","following_url":"https://api.github.com/users/gabi2/following{/other_user}","gists_url":"https://api.github.com/users/gabi2/gists{/gist_id}","starred_url":"https://api.github.com/users/gabi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabi2/subscriptions","organizations_url":"https://api.github.com/users/gabi2/orgs","repos_url":"https://api.github.com/users/gabi2/repos","events_url":"https://api.github.com/users/gabi2/events{/privacy}","received_events_url":"https://api.github.com/users/gabi2/received_events","type":"User","site_admin":false},"body":"for the moment without change log, more refactoring will follow ","created_at":"2016-01-26T12:28:57Z","updated_at":"2016-01-26T12:56:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e67bc51362701deb8606a33c28170911783f1216","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48/commits","review_comments_url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48/comments","review_comment_url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yast/yast-iscsi-client/issues/48/comments","statuses_url":"https://api.github.com/repos/yast/yast-iscsi-client/statuses/ef504240adabe260a42cf76cfd6d43228cb191ee","head":{"label":"gabi2:master","ref":"master","sha":"ef504240adabe260a42cf76cfd6d43228cb191ee","user":{"login":"gabi2","id":1658828,"avatar_url":"https://avatars.githubusercontent.com/u/1658828?v=3","gravatar_id":"","url":"https://api.github.com/users/gabi2","html_url":"https://github.com/gabi2","followers_url":"https://api.github.com/users/gabi2/followers","following_url":"https://api.github.com/users/gabi2/following{/other_user}","gists_url":"https://api.github.com/users/gabi2/gists{/gist_id}","starred_url":"https://api.github.com/users/gabi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabi2/subscriptions","organizations_url":"https://api.github.com/users/gabi2/orgs","repos_url":"https://api.github.com/users/gabi2/repos","events_url":"https://api.github.com/users/gabi2/events{/privacy}","received_events_url":"https://api.github.com/users/gabi2/received_events","type":"User","site_admin":false},"repo":{"id":26582508,"name":"yast-iscsi-client","full_name":"gabi2/yast-iscsi-client","owner":{"login":"gabi2","id":1658828,"avatar_url":"https://avatars.githubusercontent.com/u/1658828?v=3","gravatar_id":"","url":"https://api.github.com/users/gabi2","html_url":"https://github.com/gabi2","followers_url":"https://api.github.com/users/gabi2/followers","following_url":"https://api.github.com/users/gabi2/following{/other_user}","gists_url":"https://api.github.com/users/gabi2/gists{/gist_id}","starred_url":"https://api.github.com/users/gabi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabi2/subscriptions","organizations_url":"https://api.github.com/users/gabi2/orgs","repos_url":"https://api.github.com/users/gabi2/repos","events_url":"https://api.github.com/users/gabi2/events{/privacy}","received_events_url":"https://api.github.com/users/gabi2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabi2/yast-iscsi-client","description":"YaST module iscsi-client","fork":true,"url":"https://api.github.com/repos/gabi2/yast-iscsi-client","forks_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/forks","keys_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/teams","hooks_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/hooks","issue_events_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/issues/events{/number}","events_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/events","assignees_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/assignees{/user}","branches_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/branches{/branch}","tags_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/tags","blobs_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/languages","stargazers_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/stargazers","contributors_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/contributors","subscribers_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/subscribers","subscription_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/subscription","commits_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/contents/{+path}","compare_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/merges","archive_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/downloads","issues_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/issues{/number}","pulls_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/labels{/name}","releases_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/releases{/id}","deployments_url":"https://api.github.com/repos/gabi2/yast-iscsi-client/deployments","created_at":"2014-11-13T10:22:22Z","updated_at":"2016-01-26T12:20:59Z","pushed_at":"2016-01-26T12:20:58Z","git_url":"git://github.com/gabi2/yast-iscsi-client.git","ssh_url":"git@github.com:gabi2/yast-iscsi-client.git","clone_url":"https://github.com/gabi2/yast-iscsi-client.git","svn_url":"https://github.com/gabi2/yast-iscsi-client","homepage":"http://en.opensuse.org/Portal:YaST","size":822,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yast:master","ref":"master","sha":"1ad90f1ef847e93f4df240e1359d78478864e1bf","user":{"login":"yast","id":909990,"avatar_url":"https://avatars.githubusercontent.com/u/909990?v=3","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"repo":{"id":4368126,"name":"yast-iscsi-client","full_name":"yast/yast-iscsi-client","owner":{"login":"yast","id":909990,"avatar_url":"https://avatars.githubusercontent.com/u/909990?v=3","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yast/yast-iscsi-client","description":"YaST module iscsi-client","fork":false,"url":"https://api.github.com/repos/yast/yast-iscsi-client","forks_url":"https://api.github.com/repos/yast/yast-iscsi-client/forks","keys_url":"https://api.github.com/repos/yast/yast-iscsi-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yast/yast-iscsi-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yast/yast-iscsi-client/teams","hooks_url":"https://api.github.com/repos/yast/yast-iscsi-client/hooks","issue_events_url":"https://api.github.com/repos/yast/yast-iscsi-client/issues/events{/number}","events_url":"https://api.github.com/repos/yast/yast-iscsi-client/events","assignees_url":"https://api.github.com/repos/yast/yast-iscsi-client/assignees{/user}","branches_url":"https://api.github.com/repos/yast/yast-iscsi-client/branches{/branch}","tags_url":"https://api.github.com/repos/yast/yast-iscsi-client/tags","blobs_url":"https://api.github.com/repos/yast/yast-iscsi-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yast/yast-iscsi-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yast/yast-iscsi-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/yast/yast-iscsi-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yast/yast-iscsi-client/statuses/{sha}","languages_url":"https://api.github.com/repos/yast/yast-iscsi-client/languages","stargazers_url":"https://api.github.com/repos/yast/yast-iscsi-client/stargazers","contributors_url":"https://api.github.com/repos/yast/yast-iscsi-client/contributors","subscribers_url":"https://api.github.com/repos/yast/yast-iscsi-client/subscribers","subscription_url":"https://api.github.com/repos/yast/yast-iscsi-client/subscription","commits_url":"https://api.github.com/repos/yast/yast-iscsi-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/yast/yast-iscsi-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/yast/yast-iscsi-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/yast/yast-iscsi-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/yast/yast-iscsi-client/contents/{+path}","compare_url":"https://api.github.com/repos/yast/yast-iscsi-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yast/yast-iscsi-client/merges","archive_url":"https://api.github.com/repos/yast/yast-iscsi-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yast/yast-iscsi-client/downloads","issues_url":"https://api.github.com/repos/yast/yast-iscsi-client/issues{/number}","pulls_url":"https://api.github.com/repos/yast/yast-iscsi-client/pulls{/number}","milestones_url":"https://api.github.com/repos/yast/yast-iscsi-client/milestones{/number}","notifications_url":"https://api.github.com/repos/yast/yast-iscsi-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yast/yast-iscsi-client/labels{/name}","releases_url":"https://api.github.com/repos/yast/yast-iscsi-client/releases{/id}","deployments_url":"https://api.github.com/repos/yast/yast-iscsi-client/deployments","created_at":"2012-05-18T10:24:02Z","updated_at":"2015-04-17T07:44:43Z","pushed_at":"2016-01-26T12:28:58Z","git_url":"git://github.com/yast/yast-iscsi-client.git","ssh_url":"git@github.com:yast/yast-iscsi-client.git","clone_url":"https://github.com/yast/yast-iscsi-client.git","svn_url":"https://github.com/yast/yast-iscsi-client","homepage":"http://en.opensuse.org/Portal:YaST","size":1344,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48"},"html":{"href":"https://github.com/yast/yast-iscsi-client/pull/48"},"issue":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/issues/48"},"comments":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/yast/yast-iscsi-client/statuses/ef504240adabe260a42cf76cfd6d43228cb191ee"}}}}