File tree Expand file tree Collapse file tree
lib/detectify/query_builder
spec/detectify/query_builder Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ class Base
44 attr_reader :domain , :subdomain
55
66 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 )
99 end
1010
1111 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