Sha256: 6a2aaf07a34f8887504816383e2a2c0b936e7e4773a716eece952c7a5a41e061

Contents?: true

Size: 1.45 KB

Versions: 11

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

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

describe RspecGenerator do
  context 'with selenium' do
    before(:all) do
      @name = 'rspec-selenium'
      RspecGenerator.new(['selenium', 'rspec', @name]).invoke_all
    end

    it 'creates a spec file' do
      expect(File.exist?("#{@name}/spec/login_page_spec.rb")).to be_truthy
    end

    it 'creates the base spec file' do
      expect(File.exist?("#{@name}/spec/base_spec.rb")).to be_truthy
    end

    after(:all) do
      FileUtils.rm_rf(@name)
    end
  end

  context 'with watir' do
    before(:all) do
      @name = 'rspec-watir'
      RspecGenerator.new(['watir', 'rspec', @name]).invoke_all
    end

    it 'creates a spec file' do
      expect(File.exist?("#{@name}/spec/login_page_spec.rb")).to be_truthy
    end

    it 'creates the base spec file' do
      expect(File.exist?("#{@name}/spec/base_spec.rb")).to be_truthy
    end

    after(:all) do
      FileUtils.rm_rf(@name)
    end
  end

  context 'with appium' do
    before(:all) do
      @name = 'rspec-appium'
      RspecGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
    end

    it 'creates a spec file' do
      expect(File.exist?("#{@name}/spec/login_page_spec.rb")).to be_truthy
    end

    it 'creates the base spec file' do
      expect(File.exist?("#{@name}/spec/base_spec.rb")).to be_truthy
    end

    after(:all) do
      FileUtils.rm_rf(@name)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby_raider-0.4.0 spec/rspec_generator_spec.rb
ruby_raider-0.3.9 spec/rspec_generator_spec.rb
ruby_raider-0.3.8 spec/rspec_generator_spec.rb
ruby_raider-0.3.7 spec/rspec_generator_spec.rb
ruby_raider-0.3.6 spec/rspec_generator_spec.rb
ruby_raider-0.3.5 spec/rspec_generator_spec.rb
ruby_raider-0.3.4 spec/rspec_generator_spec.rb
ruby_raider-0.3.3 spec/rspec_generator_spec.rb
ruby_raider-0.3.2 spec/rspec_generator_spec.rb
ruby_raider-0.3.1 spec/rspec_generator_spec.rb
ruby_raider-0.3.0 spec/rspec_generator_spec.rb