Skip to content

Instantly share code, notes, and snippets.

@SihemBouhenniche
Created August 6, 2019 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SihemBouhenniche/0c93f49f0c317b7bb0e438c8ac83fa47 to your computer and use it in GitHub Desktop.
Save SihemBouhenniche/0c93f49f0c317b7bb0e438c8ac83fa47 to your computer and use it in GitHub Desktop.
Behavior driven design (BDD) example on web applications with cucumber and ruby
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
#@!method init_host_name
#init host name, in dummy feature the host is google.
def init_host_name
if ENV['host'].equal? nil
ENV['host'] = 'https://www.google.com'
end
end
desc 'Run google search'
task :google_search_test do
init_host_name
ruby "-S bundle exec cucumber features/tests/dummy.feature"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment