Create FindsBin spec (#18992)
This commit is contained in:
parent
d4d7d8f409
commit
ec3971a387
1 changed files with 18 additions and 0 deletions
18
spec/lib/cypress_rails/finds_bin_spec.rb
Normal file
18
spec/lib/cypress_rails/finds_bin_spec.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
require "rails_helper"
|
||||
require "cypress-rails/finds_bin"
|
||||
|
||||
RSpec.describe CypressRails::FindsBin do
|
||||
describe ".call" do
|
||||
it "finds the bin file" do
|
||||
allow(ENV).to receive(:[]).with("KNAPSACK_PRO_CI_NODE_TOTAL").and_return(nil)
|
||||
allow(ENV).to receive(:[]).with("KNAPSACK_PRO_CI_NODE_INDEX").and_return(nil)
|
||||
expect(described_class.new.call).to eq("node_modules/.bin/cypress")
|
||||
end
|
||||
|
||||
it "finds the bin file when the bin is not in the default location" do
|
||||
allow(ENV).to receive(:[]).with("KNAPSACK_PRO_CI_NODE_TOTAL").and_return("1")
|
||||
allow(ENV).to receive(:[]).with("KNAPSACK_PRO_CI_NODE_INDEX").and_return("1")
|
||||
expect(described_class.new.call).to eq("node_modules/.bin/knapsack-pro-cypress")
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue