Skip to content

Commit

Permalink
fix email check
Browse files Browse the repository at this point in the history
  • Loading branch information
tycooon committed Oct 26, 2024
1 parent 8010620 commit 0ba0c46
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
umbrellio-utils (1.5.1)
umbrellio-utils (1.5.2)
memery (~> 1)

GEM
Expand Down
28 changes: 28 additions & 0 deletions spec/umbrellio_utils/checks_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

describe UmbrellioUtils::Checks do
describe "#valid_email?" do
subject(:result) { described_class.valid_email?(input ) }
let(:input) { "user@example.com" }

it { is_expected.to eq(true) }

context "invalid input" do
let(:input) { "invalid" }

it { is_expected.to eq(false) }
end

context "input with subdomains and digits" do
let(:input) { "user@one.two42.ro" }

it { is_expected.to eq(true) }
end

context "non-string input" do
let(:input) { 123 }

it { is_expected.to eq(false) }
end
end
end

0 comments on commit 0ba0c46

Please sign in to comment.