Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate filter proposal #1075

Open
wants to merge 37 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8576e7e
Merge branch 'release/0.16.2'
jmoody Sep 17, 2015
0b9eab1
Merge pull request #856 from calabash/release/0.16.3
jmoody Sep 17, 2015
78d16b2
Merge pull request #865 from calabash/release/0.16.4
jmoody Oct 1, 2015
efb3f13
Merge pull request #946 from calabash/release/0.17.0
jmoody Dec 9, 2015
43de674
Merge pull request #981 from calabash/release/0.17.1
jmoody Jan 14, 2016
dbbe1d7
Merge pull request #988 from calabash/release/0.18.0
jmoody Feb 2, 2016
bcbc1be
Merge pull request #999 from calabash/release/0.18.1
jmoody Feb 19, 2016
ce91975
Merge pull request #1012 from calabash/release/0.18.2
jmoody Mar 11, 2016
fd8f144
Predicate filter proposal
ark-konopacki Apr 19, 2016
9fe8f33
Merge pull request #1079 from calabash/release/0.19.0
jmoody Apr 21, 2016
6c920fe
Merge branch 'develop' of https://github.com/calabash/calabash-ios in…
ark-konopacki Apr 27, 2016
33b2dd8
Added correct_predicate method
ark-konopacki Apr 27, 2016
1650d00
Added rspec tests for correct_predicate
ark-konopacki Apr 27, 2016
03ee1fb
Remove not needed part in test
ark-konopacki Apr 27, 2016
0f0cacc
added correct_format method
ark-konopacki May 10, 2016
282b64d
Review fixes, improvement in correct_predicate? method
ark-konopacki May 11, 2016
4d24fc6
Minor fixes and adding tests
ark-konopacki May 12, 2016
e226c3f
Merge pull request #1104 from calabash/release/0.19.1
jmoody May 20, 2016
7ec6933
Merge pull request #1110 from calabash/release/0.19.2
jmoody Jun 30, 2016
6af4214
Merge pull request #1153 from calabash/release/0.20.0
jmoody Sep 13, 2016
3732a0b
Merge pull request #1206 from calabash/release/0.20.3
jmoody Oct 14, 2016
4753008
Merge pull request #1250 from calabash/release/0.20.4
jmoody Jan 2, 2017
348a902
Merge pull request #1295 from calabash/release/0.20.5
jmoody Apr 19, 2017
90b064f
Merge pull request #1331 from calabash/release/0.21.1
jmoody Sep 22, 2017
a267dda
Merge pull request #4 from calabash/develop
ark-konopacki Oct 20, 2017
6b44569
Merge pull request #1342 from calabash/release/0.21.2
jmoody Nov 1, 2017
ecb035f
Merge pull request #1360 from calabash/release/0.21.4
jmoody Dec 6, 2017
ee7d0cc
Merge pull request #1373 from calabash/release/0.21.5
jmoody Apr 3, 2018
8a69cf1
Gem: bump version to 0.21.6
AlexWellsHS Aug 15, 2018
280f23c
update run_loop dependency version
AlexWellsHS Aug 30, 2018
deb6224
update cocoapod version
AlexWellsHS Aug 30, 2018
f72a770
remove RunLoop::SimControl methods from quit_sim, calabash_sim_reset
AlexWellsHS Aug 30, 2018
4dff0a2
remove SimControl reference from spec resources
AlexWellsHS Aug 30, 2018
e2d974d
remove accessibility methods and callers
AlexWellsHS Aug 31, 2018
2995a64
update .irbrc SimControl references to Simctl
AlexWellsHS Aug 31, 2018
603acef
Merge pull request #1389 from AlexWellsHS/release/0.21.6
jmoody Sep 5, 2018
503e831
Merge remote-tracking branch 'upstream/master' into feature/predicate…
ark-konopacki Sep 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions calabash-cucumber/lib/calabash-cucumber/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ def self.raw_map(query, method_name, *method_args)
:arguments => method_args
}

# this is ugly but working
if !query.match(/{.*}/).nil?
str = query.match(/{.*}/)[0]
correct = false
predicate = %w(BEGINSWITH CONTAINS ENDSWITH LIKE MATCHES)
predicate.each do |value|
if str.include?(value)
correct = true
end
end
if !correct
fail "Incorrect predicate used, valid selectors are #{predicate}"
end

end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's extract this to a method and add some rspec tests.

res = Map.new.http({:method => :post, :path => 'map'},
{:query => query, :operation => operation_map})
res = JSON.parse(res)
Expand Down