Skip to content

Commit

Permalink
Update Regex to String
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkitkkr committed Jan 28, 2023
1 parent 3d90b02 commit 70cd5a1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/dummy/spec/packs_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# rubocop:disable Metrics/ModuleLength
module ReactOnRails
GENERATED_PACKS_OUTPUT_REGEX = /Generated Packs:/.freeze
GENERATED_PACKS_CONSOLE_OUTPUT_TEXT= "Generated Packs:"

# rubocop:disable Metrics/BlockLength
describe PacksGenerator do
Expand Down Expand Up @@ -264,25 +264,25 @@ module ReactOnRails
end

it "does not generate packs if there are no new components or stale files" do
expect { described_class.generate }.to output(GENERATED_PACKS_OUTPUT_REGEX).to_stdout
expect { described_class.generate }.to output(GENERATED_PACKS_CONSOLE_OUTPUT_TEXT).to_stdout

expect { described_class.generate }.not_to output(GENERATED_PACKS_OUTPUT_REGEX).to_stdout
expect { described_class.generate }.not_to output(GENERATED_PACKS_CONSOLE_OUTPUT_TEXT).to_stdout
end

it "generate packs if a new component is added" do
expect { described_class.generate }.to output(GENERATED_PACKS_OUTPUT_REGEX).to_stdout
expect { described_class.generate }.to output(GENERATED_PACKS_CONSOLE_OUTPUT_TEXT).to_stdout

create_new_component("NewComponent")

expect { described_class.generate }.to output(GENERATED_PACKS_OUTPUT_REGEX).to_stdout
expect { described_class.generate }.to output(GENERATED_PACKS_CONSOLE_OUTPUT_TEXT).to_stdout
end

it "generate packs if an old component is updated" do
expect { described_class.generate }.to output(GENERATED_PACKS_OUTPUT_REGEX).to_stdout
expect { described_class.generate }.to output(GENERATED_PACKS_CONSOLE_OUTPUT_TEXT).to_stdout

create_new_component(component_name)

expect { described_class.generate }.to output(GENERATED_PACKS_OUTPUT_REGEX).to_stdout
expect { described_class.generate }.to output(GENERATED_PACKS_CONSOLE_OUTPUT_TEXT).to_stdout
end

def create_new_component(name)
Expand Down

0 comments on commit 70cd5a1

Please sign in to comment.