Sha256: cb3fb6fa88e5dee9dbb5338ff929723389d0452a12160716273342a210c31ea6

Contents?: true

Size: 1.69 KB

Versions: 17

Compression:

Stored size: 1.69 KB

Contents

# frozen_string_literal: true

require_relative '../../../lib/generators/rspec/rspec_generator'
require_relative '../spec_helper'

describe RspecGenerator do
  shared_examples 'creates factory files' do |project_name|
    it 'creates a model factory file' do
      expect(File).to exist("#{project_name}/models/model_factory.rb")
    end

    it 'creates the data for the factory' do
      expect(File).to exist("#{project_name}/models/data/users.yml")
    end
  end

  shared_examples 'creates rspec files examples' do |project_name, file_name|
    it 'creates a spec file' do
      expect(File).to exist("#{project_name}/spec/#{file_name}_page_spec.rb")
    end
  end

  context 'with rspec and selenium' do
    include_examples 'creates factory files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
    include_examples 'creates rspec files examples',
                     "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}", 'login'
  end

  context 'with rspec and watir' do
    include_examples 'creates factory files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
    include_examples 'creates rspec files examples',
                     "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}", 'login'
  end

  context 'with rspec and appium android' do
    include_examples 'creates rspec files examples',
                     "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}", 'pdp'
  end

  context 'with rspec and appium ios' do
    include_examples 'creates rspec files examples',
                     "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}", 'pdp'
  end

  context 'with rspec and appium cross platform' do
    include_examples 'creates rspec files examples',
                     "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}", 'pdp'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby_raider-1.1.1 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.1.0 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.9 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.8 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.7 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.6 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.5 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.4 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.3 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.2 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.1 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-1.0.0 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-0.9.9 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-0.9.8 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-0.9.7 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-0.9.6 spec/integration/generators/rspec_generator_spec.rb
ruby_raider-0.9.5 spec/integration/generators/rspec_generator_spec.rb