File tree 2 files changed +19
-2
lines changed
lib/detectify/query_builder
spec/detectify/query_builder
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ class Base
4
4
attr_reader :domain , :subdomain
5
5
6
6
def initialize ( domain , subdomain )
7
- @domain = domain
8
- @subdomain = subdomain
7
+ @domain = domain . downcase if domain . is_a? ( String )
8
+ @subdomain = subdomain . downcase if subdomain . is_a? ( String )
9
9
end
10
10
11
11
def build
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ RSpec . describe Detectify ::QueryBuilder ::Base do
4
+ let ( :domain ) { 'DOMAIN' }
5
+ let ( :subdomain ) { 'SUBDOMAIN' }
6
+ subject { Detectify ::QueryBuilder ::Base . new ( domain , subdomain ) }
7
+
8
+ describe '#initialize' do
9
+ it 'sets domain in downcase' do
10
+ expect ( subject . domain ) . to eq ( domain . downcase )
11
+ end
12
+
13
+ it 'sets subdomain in downcase' do
14
+ expect ( subject . subdomain ) . to eq ( subdomain . downcase )
15
+ end
16
+ end
17
+ end
You can’t perform that action at this time.
0 commit comments