diff options
| author | mo khan <mo@mokhan.ca> | 2021-05-09 21:17:31 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-05-09 21:17:31 -0600 |
| commit | ea979dbb9090dc4eedb685eef6728f13fa124fa5 (patch) | |
| tree | 04770d97460de747d180fe501d899d1a6f1ee221 /spec | |
| parent | 6c100339886de690be1fa20d30acb685f00a2484 (diff) | |
feat: detect `.terraform.lock.hcl` files
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/unit/terraform/parsers/lock_file_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/unit/terraform/parsers/lock_file_spec.rb b/spec/unit/terraform/parsers/lock_file_spec.rb index 0d7c10d..56eecd0 100644 --- a/spec/unit/terraform/parsers/lock_file_spec.rb +++ b/spec/unit/terraform/parsers/lock_file_spec.rb @@ -3,6 +3,12 @@ RSpec.describe Spandx::Terraform::Parsers::LockFile do subject(:parser) { described_class.new } + describe '#match?' do + it { is_expected.to be_match(to_path('.terraform.lock.hcl')) } + it { is_expected.not_to be_match(to_path('main.hcl')) } + it { is_expected.not_to be_match(to_path('main.tf')) } + end + describe '#parse' do def build(name, version, path) Spandx::Core::Dependency.new(name: name, version: version, path: path) @@ -13,7 +19,11 @@ RSpec.describe Spandx::Terraform::Parsers::LockFile do let(:path) { fixture_file('terraform/simple/.terraform.lock.hcl') } - specify { expect(subject).to match_array([build('registry.terraform.io/hashicorp/aws', '0.39.0', path)]) } + specify do + expect(subject).to match_array([ + build('registry.terraform.io/hashicorp/aws', '3.39.0', path) + ]) + end end end end |
