Sha256: 92ffd565819a5e802ce9dd46dba9d768163b5aefc7c957e3a293314bd791df15

Contents?: true

Size: 919 Bytes

Versions: 10

Compression:

Stored size: 919 Bytes

Contents

require 'cypress_on_rails/command_executor'

RSpec.describe CypressOnRails::CommandExecutor do
  describe '.load' do
    let(:folder) { "#{__dir__}/command_executor" }
    subject { described_class }

    def executor_load(*values)
      subject.load(*values)
    end

    before do
      CypressOnRails.configuration.cypress_folder = folder
      DummyTest.values.clear if defined?(DummyTest)
    end

    it 'runs test command' do
      executor_load("#{folder}/test_command.rb")
      expect(DummyTest.values).to eq(%w(hello))
    end

    it 'runs test command twice' do
      executor_load("#{folder}/test_command.rb")
      executor_load("#{folder}/test_command.rb")
      expect(DummyTest.values).to eq(%w(hello hello))
    end

    it 'runs command with options' do
      executor_load("#{folder}/test_command_with_options.rb", 'my_string')
      expect(DummyTest.values).to eq(%w(my_string))
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cypress-on-rails-1.9.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.8.1 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.8.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.7.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.6.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.5.1 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.5.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.4.2 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.4.1 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.4.0 spec/cypress_on_rails/command_executor_spec.rb