-
Notifications
You must be signed in to change notification settings - Fork 6
/
query_steps.rb
32 lines (28 loc) · 1014 Bytes
/
query_steps.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
When /^(?:I )?filter for only the species$/ do |table|
# table is a Cucumber::Ast::Table
sp = table.raw.collect { |row| row[0] }
thing = @access || @parser
thing.sequence_filter = { :only_species => sp }
end
When /^(?:I )?filter for blocks with the species$/ do |table|
# table is a Cucumber::Ast::Table
sp = table.raw.collect { |row| row[0] }
@block_filter = { :with_all_species => sp }
end
When /^(?:I )?filter for blocks with at least (\d+) sequences$/ do |n|
@block_filter = { :at_least_n_sequences => n.to_i }
end
When /^(?:I )?filter for blocks with text size at (least|most) (\d+)$/ do |op, len|
constraint = case op
when 'least' then :min_size
when 'most' then :max_size
else raise "bad operator #{op}!"
end
@block_filter = { constraint => len.to_i}
end
When /^(?:I )?filter for blocks with text size between (\d+) and (\d+)$/ do |min, max|
@block_filter = {
:min_size => min.to_i,
:max_size => max.to_i
}
end