Skip to content

Commit

Permalink
Fix weld spec (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods authored Dec 23, 2024
1 parent c5a6690 commit 41a8537
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
34 changes: 17 additions & 17 deletions gems/smithy/spec/interfaces/polish_spec.rb
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# frozen_string_literal: true

describe 'Types: Polishing' do
Class.new(Smithy::Polish) do
def polish(artifact)
file, _content = artifact.find { |file, _content| file.include?('/types.rb') }
inject_into_module(file, 'Types') do
" Polish = Struct.new(keyword_init: true)\n"
before(:all) do
# Define Polish classes (scoped to this block only)
Class.new(Smithy::Polish) do
def polish(artifact)
file, _content = artifact.find { |file, _content| file.include?('/types.rb') }
inject_into_module(file, 'Types') do
" Polish = Struct.new(keyword_init: true)\n"
end
end
end
end

Class.new(Smithy::Polish) do
def for?(_model)
false
end
Class.new(Smithy::Polish) do
def for?(_model)
false
end

def polish(artifact)
file, _content = artifact.find { |file, _content| file.include?('/types.rb') }
inject_into_module(file, 'Types') do
" ShouldNotExist = Struct.new(keyword_init: true)\n"
def polish(artifact)
file, _content = artifact.find { |file, _content| file.include?('/types.rb') }
inject_into_module(file, 'Types') do
" ShouldNotExist = Struct.new(keyword_init: true)\n"
end
end
end
end

before(:all) do
@tmpdir = SpecHelper.generate(['Weather'], :types)
end

Expand Down
25 changes: 13 additions & 12 deletions gems/smithy/spec/interfaces/weld_spec.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# frozen_string_literal: true

describe 'Types: Welding' do
Class.new(Smithy::Weld) do
def preprocess(model)
model['shapes']['example.weather#Weld'] = { 'type' => 'structure', 'members' => {} }
before(:all) do
# Define Weld classes (scoped to this block only)
Class.new(Smithy::Weld) do
def preprocess(model)
model['shapes']['example.weather#Weld'] = { 'type' => 'structure', 'members' => {} }
end
end
end

Class.new(Smithy::Weld) do
def for?(_model)
false
end
Class.new(Smithy::Weld) do
def for?(_model)
false
end

def preprocess(model)
model['shapes']['example.weather#ShouldNotExist'] = { 'type' => 'structure', 'members' => {} }
def preprocess(model)
model['shapes']['example.weather#ShouldNotExist'] = { 'type' => 'structure', 'members' => {} }
end
end
end

before(:all) do
@tmpdir = SpecHelper.generate(['Weather'], :types)
end

Expand Down

0 comments on commit 41a8537

Please sign in to comment.