-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e91767c
commit 0fa0d87
Showing
10 changed files
with
171 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Run RSpec Tests | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.0' | ||
|
||
- name: Install dependencies | ||
run: | | ||
gem install bundler | ||
bundle install | ||
- name: Run RSpec | ||
run: bundle exec rspec solara/lib/spec/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
require 'rspec' | ||
require_relative '../solara.rb' | ||
Dir.glob("../core/scripts/*.rb").each { |file| require file } | ||
|
||
RSpec.describe SolaraManager do | ||
let(:manager) { SolaraManager.new } | ||
let(:brand_key) { 'brand1' } | ||
let(:brand_name) { 'Brand 1' } | ||
let(:clone_brand_key) { 'brand1' } | ||
let(:configurations) { { key: 'value' } } | ||
let(:path) { '/path/to/export' } | ||
|
||
describe '#init' do | ||
it 'initializes with the given platform and brand details' do | ||
test_lab = FilePath.test_lab | ||
FileManager.delete_if_exists(test_lab) | ||
|
||
# Define the repository URL and the target directory | ||
repo_url = 'https://github.com/Solara-Kit/TestLab.git' | ||
|
||
# Clone the repository | ||
system("git clone #{repo_url} #{test_lab}") | ||
|
||
# Check if the clone was successful | ||
if $?.success? | ||
puts "Successfully cloned #{repo_url} into #{test_lab}." | ||
else | ||
puts "Failed to clone the repository." | ||
end | ||
|
||
SolaraSettingsManager.instance.environment = SolaraEnvironment::Test | ||
SolaraSettingsManager.instance.root = Pathname.new(File.expand_path('../..', __FILE__)) | ||
SolaraSettingsManager.instance.project_root = File.join(test_lab, 'flutter') | ||
SolaraSettingsManager.instance.platform = 'flutter' | ||
|
||
expect { manager.init(brand_key, brand_name) }.not_to raise_error | ||
|
||
is_current_brand = BrandsManager.instance.is_current_brand(brand_key) | ||
expect(is_current_brand).to be true | ||
end | ||
end | ||
|
||
# describe '#import' do | ||
# it 'imports configurations correctly' do | ||
# expect { manager.import(configurations) }.not_to raise_error | ||
# end | ||
# end | ||
# | ||
# describe '#export' do | ||
# it 'exports brand keys to the specified path' do | ||
# expect { manager.export([brand_key], path) }.not_to raise_error | ||
# end | ||
# end | ||
# | ||
# describe '#status' do | ||
# it 'checks the status without errors' do | ||
# expect { manager.status }.not_to raise_error | ||
# end | ||
# end | ||
# | ||
# describe '#onboard' do | ||
# context 'when the brand does not exist' do | ||
# it 'onboards a new brand successfully' do | ||
# expect { manager.onboard(brand_key, brand_name) }.to output(/Onboarded #{brand_key} successfully/).to_stdout | ||
# end | ||
# end | ||
# | ||
# context 'when the brand already exists' do | ||
# before do | ||
# allow(BrandsManager.instance).to receive(:exists).with(brand_key).and_return(true) | ||
# end | ||
# | ||
# it 'does not onboard and logs a fatal message' do | ||
# expect { manager.onboard(brand_key, brand_name) }.to output(/Brand with key/).to_stdout | ||
# end | ||
# end | ||
# end | ||
# | ||
# describe '#offboard' do | ||
# it 'offboards the brand without errors' do | ||
# expect { manager.offboard(brand_key) }.not_to raise_error | ||
# end | ||
# end | ||
# | ||
# describe '#switch' do | ||
# it 'switches to the specified brand' do | ||
# expect { manager.switch(brand_key) }.not_to raise_error | ||
# end | ||
# end | ||
# | ||
# describe '#dashboard' do | ||
# it 'opens the dashboard for the specified brand' do | ||
# expect { manager.dashboard(brand_key) }.not_to raise_error | ||
# end | ||
# end | ||
# | ||
# describe '#doctor' do | ||
# it 'runs doctor on the specified brand' do | ||
# expect { manager.doctor(brand_key) }.not_to raise_error | ||
# end | ||
# end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters