{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/57911683","id":57911683,"diff_hunk":"@@ -590,9 +590,42 @@\n     expect(filter.to_ruby).to eq('<value ref=vm, type=integer>/virtual/used_disk_storage</value> >= 1048576000')\n   end\n \n+  it 'should test .is_numeric' do\n+    expect(MiqExpression.is_numeric?('10,000.55')).to eq(true)\n+    expect(MiqExpression.is_numeric?('10 000.55')).to eq(false)\n+\n+    expect(MiqExpression.is_numeric?('2,555.hello')).to eq(false)\n+    expect(MiqExpression.is_numeric?('2,555.kilobytes')).to eq(true)\n+    expect(MiqExpression.is_numeric?('2,555.55.megabytes')).to eq(true)\n+  end\n+\n+  it 'should test .is_integer' do\n+    expect(MiqExpression.is_integer?('2,555')).to eq(true)\n+    expect(MiqExpression.is_integer?('2 555')).to eq(false)\n+\n+    expect(MiqExpression.is_integer?('2,555.kilobytes')).to eq(true)\n+    expect(MiqExpression.is_integer?('2,555.hello')).to eq(false)\n+  end\n+\n+  it 'should test .is_plural' do\n+    field = 'ManageIQ::Providers::InfraManager::Vm.storage-region_description' # vm belong_to storage\n+    expect(MiqExpression.is_plural?(field)).to eq(false)\n+    field = 'ManageIQ::Providers::InfraManager::Vm.repositories-name' # vm has_many repositories\n+    expect(MiqExpression.is_plural?(field)).to eq(true)\n+  end\n+\n   describe \".atom_error\" do\n     it \"should test atom error\" do\n       expect(MiqExpression.atom_error(\"Host-xx\", \"regular expression matches\", '123[)')).not_to be_falsey\n+      expect(MiqExpression.atom_error(\"Host-xx\", \"regular expression matches\", '/foo/')).to be_falsey\n+\n+      # Ruby scripts in expressions are no longer supported.\n+      expect(MiqExpression.atom_error(\"VmPerformance-cpu_usage_rate_average\", \"ruby\", '')).not_to be_falsey","path":"spec/models/miq_expression/miq_expression_spec.rb","position":34,"original_position":34,"commit_id":"819952a6e9aa8ef7347e1c3ca1a5c34ede127bff","original_commit_id":"819952a6e9aa8ef7347e1c3ca1a5c34ede127bff","user":{"login":"imtayadeway","id":1710874,"avatar_url":"https://avatars.githubusercontent.com/u/1710874?v=3","gravatar_id":"","url":"https://api.github.com/users/imtayadeway","html_url":"https://github.com/imtayadeway","followers_url":"https://api.github.com/users/imtayadeway/followers","following_url":"https://api.github.com/users/imtayadeway/following{/other_user}","gists_url":"https://api.github.com/users/imtayadeway/gists{/gist_id}","starred_url":"https://api.github.com/users/imtayadeway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imtayadeway/subscriptions","organizations_url":"https://api.github.com/users/imtayadeway/orgs","repos_url":"https://api.github.com/users/imtayadeway/repos","events_url":"https://api.github.com/users/imtayadeway/events{/privacy}","received_events_url":"https://api.github.com/users/imtayadeway/received_events","type":"User","site_admin":false},"body":"These `not_to be_falsey`'s might be better expressed as `to be_truthy`","created_at":"2016-03-30T15:43:54Z","updated_at":"2016-03-30T15:43:54Z","html_url":"https://github.com/ManageIQ/manageiq/pull/7583#discussion_r57911683","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/57911683"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/7583#discussion_r57911683"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583","id":64543343,"html_url":"https://github.com/ManageIQ/manageiq/pull/7583","diff_url":"https://github.com/ManageIQ/manageiq/pull/7583.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/7583.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/7583","number":7583,"state":"open","locked":false,"title":"[WIP] Added tests for .atom_error in miq_expression","user":{"login":"yrudman","id":6556758,"avatar_url":"https://avatars.githubusercontent.com/u/6556758?v=3","gravatar_id":"","url":"https://api.github.com/users/yrudman","html_url":"https://github.com/yrudman","followers_url":"https://api.github.com/users/yrudman/followers","following_url":"https://api.github.com/users/yrudman/following{/other_user}","gists_url":"https://api.github.com/users/yrudman/gists{/gist_id}","starred_url":"https://api.github.com/users/yrudman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrudman/subscriptions","organizations_url":"https://api.github.com/users/yrudman/orgs","repos_url":"https://api.github.com/users/yrudman/repos","events_url":"https://api.github.com/users/yrudman/events{/privacy}","received_events_url":"https://api.github.com/users/yrudman/received_events","type":"User","site_admin":false},"body":"Added tests to cover .is_plural?, .is_numeric?, is_integer?. Added tests to fully cover .atom_error.\r\nRemoved not reachable code and fixed return if field is not recognized in .atom_error\r\n","created_at":"2016-03-29T22:17:02Z","updated_at":"2016-03-30T15:43:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5af2f82cd8158a2919f0f7c3fb02b04bb4c7bb1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/7583/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/819952a6e9aa8ef7347e1c3ca1a5c34ede127bff","head":{"label":"yrudman:added-specs-to-miq-expression","ref":"added-specs-to-miq-expression","sha":"819952a6e9aa8ef7347e1c3ca1a5c34ede127bff","user":{"login":"yrudman","id":6556758,"avatar_url":"https://avatars.githubusercontent.com/u/6556758?v=3","gravatar_id":"","url":"https://api.github.com/users/yrudman","html_url":"https://github.com/yrudman","followers_url":"https://api.github.com/users/yrudman/followers","following_url":"https://api.github.com/users/yrudman/following{/other_user}","gists_url":"https://api.github.com/users/yrudman/gists{/gist_id}","starred_url":"https://api.github.com/users/yrudman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrudman/subscriptions","organizations_url":"https://api.github.com/users/yrudman/orgs","repos_url":"https://api.github.com/users/yrudman/repos","events_url":"https://api.github.com/users/yrudman/events{/privacy}","received_events_url":"https://api.github.com/users/yrudman/received_events","type":"User","site_admin":false},"repo":{"id":50465345,"name":"manageiq","full_name":"yrudman/manageiq","owner":{"login":"yrudman","id":6556758,"avatar_url":"https://avatars.githubusercontent.com/u/6556758?v=3","gravatar_id":"","url":"https://api.github.com/users/yrudman","html_url":"https://github.com/yrudman","followers_url":"https://api.github.com/users/yrudman/followers","following_url":"https://api.github.com/users/yrudman/following{/other_user}","gists_url":"https://api.github.com/users/yrudman/gists{/gist_id}","starred_url":"https://api.github.com/users/yrudman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrudman/subscriptions","organizations_url":"https://api.github.com/users/yrudman/orgs","repos_url":"https://api.github.com/users/yrudman/repos","events_url":"https://api.github.com/users/yrudman/events{/privacy}","received_events_url":"https://api.github.com/users/yrudman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yrudman/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/yrudman/manageiq","forks_url":"https://api.github.com/repos/yrudman/manageiq/forks","keys_url":"https://api.github.com/repos/yrudman/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yrudman/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yrudman/manageiq/teams","hooks_url":"https://api.github.com/repos/yrudman/manageiq/hooks","issue_events_url":"https://api.github.com/repos/yrudman/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/yrudman/manageiq/events","assignees_url":"https://api.github.com/repos/yrudman/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/yrudman/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/yrudman/manageiq/tags","blobs_url":"https://api.github.com/repos/yrudman/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yrudman/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yrudman/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/yrudman/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yrudman/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/yrudman/manageiq/languages","stargazers_url":"https://api.github.com/repos/yrudman/manageiq/stargazers","contributors_url":"https://api.github.com/repos/yrudman/manageiq/contributors","subscribers_url":"https://api.github.com/repos/yrudman/manageiq/subscribers","subscription_url":"https://api.github.com/repos/yrudman/manageiq/subscription","commits_url":"https://api.github.com/repos/yrudman/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/yrudman/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/yrudman/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/yrudman/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/yrudman/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/yrudman/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yrudman/manageiq/merges","archive_url":"https://api.github.com/repos/yrudman/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yrudman/manageiq/downloads","issues_url":"https://api.github.com/repos/yrudman/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/yrudman/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/yrudman/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/yrudman/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yrudman/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/yrudman/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/yrudman/manageiq/deployments","created_at":"2016-01-26T22:55:59Z","updated_at":"2016-01-26T22:56:16Z","pushed_at":"2016-03-30T13:00:26Z","git_url":"git://github.com/yrudman/manageiq.git","ssh_url":"git@github.com:yrudman/manageiq.git","clone_url":"https://github.com/yrudman/manageiq.git","svn_url":"https://github.com/yrudman/manageiq","homepage":"manageiq.org","size":112301,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"e5d3c9b886e8e6c0bb2e06c728560f6e36fe44bd","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Cloud Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-03-30T13:34:57Z","pushed_at":"2016-03-30T15:04:10Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":151196,"stargazers_count":246,"watchers_count":246,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":265,"mirror_url":null,"open_issues_count":626,"forks":265,"open_issues":626,"watchers":246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/7583"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/7583"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/7583/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7583/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/819952a6e9aa8ef7347e1c3ca1a5c34ede127bff"}}}}