Skip to content

Commit f51882c

Browse files
author
Andre Medeiros
committed
move to rspec; add ruby tests
1 parent 23982d8 commit f51882c

File tree

18 files changed

+291
-271
lines changed

18 files changed

+291
-271
lines changed

Diff for: .github/workflows/integration.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ jobs:
55
strategy:
66
matrix:
77
platform: [ubuntu-latest, macos-latest]
8+
tag: ["~dependency" "dependency:ruby"]
89
runs-on: ${{ matrix.platform }}
910
steps:
1011
- name: Install Go
@@ -27,4 +28,4 @@ jobs:
2728
- name: Bundle Install
2829
run: bundle install
2930
- name: Integration Tests
30-
run: rake test
31+
run: bundle exec rspec --tag ${{ matrix.tag }}

Diff for: .rspec

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

Diff for: Gemfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
source 'https://rubygems.org'
22

3-
gem 'minitest', '~> 5.14.1'
4-
gem 'minitest-hooks', '~> 1.5.0'
5-
gem 'rake', '~> 13.0.1'
3+
gem 'byebug', '~> 11.1.3'
4+
gem 'rspec', '~> 3.9.0'

Diff for: Gemfile.lock

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
minispec-metadata (3.3.1)
5-
minitest
6-
minitest (5.14.1)
7-
minitest-hooks (1.5.0)
8-
minitest (> 5.3)
9-
rake (13.0.1)
4+
byebug (11.1.3)
5+
diff-lcs (1.4.4)
6+
rspec (3.9.0)
7+
rspec-core (~> 3.9.0)
8+
rspec-expectations (~> 3.9.0)
9+
rspec-mocks (~> 3.9.0)
10+
rspec-core (3.9.2)
11+
rspec-support (~> 3.9.3)
12+
rspec-expectations (3.9.2)
13+
diff-lcs (>= 1.2.0, < 2.0)
14+
rspec-support (~> 3.9.0)
15+
rspec-mocks (3.9.1)
16+
diff-lcs (>= 1.2.0, < 2.0)
17+
rspec-support (~> 3.9.0)
18+
rspec-support (3.9.3)
1019

1120
PLATFORMS
1221
ruby
1322

1423
DEPENDENCIES
15-
minispec-metadata (~> 3.3.1)
16-
minitest (~> 5.14.1)
17-
minitest-hooks (~> 1.5.0)
18-
rake (~> 13.0.1)
24+
byebug (~> 11.1.3)
25+
rspec (~> 3.9.0)
1926

2027
BUNDLED WITH
2128
2.1.4

Diff for: Rakefile

-9
This file was deleted.

Diff for: integration/commands/cd_test.rb

-10
This file was deleted.

Diff for: integration/commands/clone_test.rb

-33
This file was deleted.

Diff for: integration/commands/doctor_test.rb

-28
This file was deleted.

Diff for: integration/dependencies/ruby_test.rb

-32
This file was deleted.

Diff for: integration/test_helper.rb

-143
This file was deleted.

Diff for: internal/catalog/bindata.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: internal/task/root.go

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func Run(ctx context.Context, ui ui.UI, p *project.Project, name string, fun fun
6060
if err := te.Resolve(ctx, p); err != nil {
6161
s.Fail()
6262
errs <- err
63+
return
6364
} else {
6465
done, err := te.Check(ctx, p)
6566
if err != nil {

Diff for: loon.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ tasks:
2525
command: go test ./... -v -bench=. $@
2626
integration:
2727
description: Runs integration tests
28-
command: rake test
28+
command: bundle exec rspec --tag "~dependency"
29+
integration:dependency:
30+
description: Runs integration tests (with dependencies)
31+
command: bundle exec rspec

Diff for: spec/commands/cd_spec.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
describe 'Commands' do
2+
describe 'cd' do
3+
it 'should emit a finisher' do
4+
loon %w(cd andremedeiros/loon)
5+
6+
assert_status 0
7+
assert_finalizer 'chdir', "#{ENV['HOME']}/src/github.com/andremedeiros/loon"
8+
end
9+
end
10+
end

Diff for: spec/commands/clone_spec.rb

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
describe 'Commands' do
2+
describe 'clone' do
3+
around(:each) do |example|
4+
with_environment(home: Dir.mktmpdir) do
5+
example.run
6+
end
7+
end
8+
9+
it 'should respect source tree setting' do
10+
with_config(source_tree: '$HOME/{owner}/{name}') do
11+
loon %w(clone andremedeiros/ruby-demo)
12+
13+
assert_status 0
14+
assert_path "#{ENV['HOME']}/andremedeiros/ruby-demo/.git"
15+
end
16+
end
17+
18+
it 'should check out a repo' do
19+
loon %w(clone andremedeiros/ruby-demo)
20+
21+
assert_status 0
22+
assert_path "#{ENV['HOME']}/src/github.com/andremedeiros/ruby-demo/.git"
23+
end
24+
25+
it 'should emit a finisher' do
26+
loon %w(clone andremedeiros/ruby-demo)
27+
28+
assert_status 0
29+
assert_finalizer 'chdir', "#{ENV['HOME']}/src/github.com/andremedeiros/ruby-demo"
30+
end
31+
end
32+
end

0 commit comments

Comments
 (0)