Sha256: 40a57adc4654bb831430e38816a4e8c4d72fc6079653ea41de0f0888ee4633c7

Contents?: true

Size: 940 Bytes

Versions: 8

Compression:

Stored size: 940 Bytes

Contents

require 'cypress_on_rails/command_executor'

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

    def executor_perform(*values)
      subject.perform(*values)
    end

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

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

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cypress-on-rails-1.14.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.13.1 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.13.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.12.1 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.12.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.11.0 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.10.1 spec/cypress_on_rails/command_executor_spec.rb
cypress-on-rails-1.9.1 spec/cypress_on_rails/command_executor_spec.rb