Sha256: 993e4a3675969ac8fba62ec4275a7744e299c1797c8dcead72c90f8538dbc74d

Contents?: true

Size: 1.41 KB

Versions: 4

Compression:

Stored size: 1.41 KB

Contents

# assertions.rb - General assertions to be used with a Selector

Then(/^it is equal to `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| eq v}
end
Then(/^it is equal to:$/) do |value|
  selector.assert_that(value) {|v| eq v}
end
Then(/^it is matching `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| match v}
end
Then (/^it is matching:$/) do |value|
  selector.assert_that(value) {|v| match v}
end
Then(/^it is greater than `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| be > v}
end
Then(/^it is greater than or equal to `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| be >= v}
end
Then(/^it is less than `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| be < v}
end
Then(/^it is less than or equal to `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| be <= v}
end

# Be a little smarter than default.
Then(/^it is empty$/) do
  selector.assert_that(nil) do
    satisfy{|i| i.nil? || (i.respond_to?(:empty?) && i.empty?) }
  end
end

Then(/^it is including `([^`]*)`$/) do |value|
  selector.assert_that(value) {|v| include v }
end
Then(/^it is including:$/) do |value|
  selector.assert_that(value) {|v| include v }
end

Then(/^it is a valid `([^`]*)`$/) do |type|
  selector.assert_that(type) {|t| type_check_for(t) }
end

Then(/^it is of length `([^`]*)`$/) do |length|
  selector.assert_that(length) do |l|
    satisfy{|i| i.respond_to?(:length) && i.length == l}
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
brine-dsl-0.9.0 lib/brine/step_definitions/assertions.rb
brine-dsl-0.8.1 lib/brine/step_definitions/assertions.rb
brine-dsl-0.8.0 lib/brine/step_definitions/assertions.rb
brine-dsl-0.7.0 lib/brine/step_definitions/assertions.rb