Sha256: fa457163215ba4584280975a4e3c54d36359594c764513ab8f8b15a7c26ca052

Contents?: true

Size: 1.46 KB

Versions: 14

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

require_relative '../lib/generators/cucumber_generator'
require_relative 'spec_helper'

describe CucumberGenerator do
  shared_examples 'creates cucumber files' do |project_name, file_name|
    it 'creates a feature file' do
      expect(File).to exist("#{project_name}/features/#{file_name}.feature")
    end

    it 'creates a step definitions file' do
      expect(File).to exist("#{project_name}/features/step_definitions/#{file_name}_steps.rb")
    end

    it 'creates an env file' do
      expect(File).to exist("#{project_name}/features/support/env.rb")
    end

    it 'does not create a spec file' do
      expect(File).not_to exist("#{project_name}/spec/home_spec.rb")
    end
  end

  context 'with cucumber and appium android' do
    include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}", 'home'
  end

  context 'with cucumber and appium ios' do
    include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}", 'home'
  end

  context 'with cucumber and appium cross platform' do
    include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}", 'home'
  end

  context 'with cucumber and selenium' do
    include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}", 'login'
  end

  context 'with cucumber and watir' do
    include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}", 'login'
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ruby_raider-0.5.6 spec/cucumber_generator_spec.rb
ruby_raider-0.5.5 spec/cucumber_generator_spec.rb
ruby_raider-0.5.4 spec/cucumber_generator_spec.rb
ruby_raider-0.5.3 spec/cucumber_generator_spec.rb
ruby_raider-0.5.2 spec/cucumber_generator_spec.rb
ruby_raider-0.5.1 spec/cucumber_generator_spec.rb
ruby_raider-0.5.0 spec/cucumber_generator_spec.rb
ruby_raider-0.4.9 spec/cucumber_generator_spec.rb
ruby_raider-0.4.8 spec/cucumber_generator_spec.rb
ruby_raider-0.4.7 spec/cucumber_generator_spec.rb
ruby_raider-0.4.6 spec/cucumber_generator_spec.rb
ruby_raider-0.4.5 spec/cucumber_generator_spec.rb
ruby_raider-0.4.4 spec/cucumber_generator_spec.rb
ruby_raider-0.4.3 spec/cucumber_generator_spec.rb