diff options
| author | Stormwind <stormwind@stormwinds-page.de> | 2013-01-05 18:30:36 +0100 | 
|---|---|---|
| committer | Stormwind <stormwind@stormwinds-page.de> | 2013-01-05 18:30:36 +0100 | 
| commit | 3bb53d7343915e1a9f75f5ca4b53d61313b0ef29 (patch) | |
| tree | 688889e58d9d4c1e84a815442771826abf8dea7e /spec | |
| parent | 5ca122b84c080c67082eeb5d0571e0baf6a1716e (diff) | |
Kill almost all mutants in Zero::Request:AcceptType
Killed 13 of 14 mutants. I will see later, how it's possible to kill the last
one.
I also fixed the return value of "preferred", if the in initialize given string
is empty. Fixed the default value here.
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/unit/request/accepttype/preferred_spec.rb | 17 | 
1 files changed, 11 insertions, 6 deletions
| diff --git a/spec/unit/request/accepttype/preferred_spec.rb b/spec/unit/request/accepttype/preferred_spec.rb index 1156aa0..ef21e8d 100644 --- a/spec/unit/request/accepttype/preferred_spec.rb +++ b/spec/unit/request/accepttype/preferred_spec.rb @@ -7,18 +7,23 @@ describe Zero::Request::AcceptType, '#preferred' do    let(:foo)  { 'text/foo' }    let(:lower_quality) { foo + ';q=0.5' }    let(:default) { '*/*;q=0.1' } +  let(:option)  { [foo + ';b=23', html].join(',') }    let(:simple_accept)  { [html, json].join(',') }    let(:quality_accept) { [html, lower_quality, default].join(',') }    let(:random_accept)  { [lower_quality, default, html].join(',') }    let(:lower_accept)   { [lower_quality, default].join(',') }    context 'without mapping' do -    it { subject.new(html).preferred.should           == html } -    it { subject.new(json).preferred.should           == json } -    it { subject.new(simple_accept).preferred.should  == html } -    it { subject.new(quality_accept).preferred.should == html } -    it { subject.new(random_accept).preferred.should  == html } -    it { subject.new(lower_accept).preferred.should   == foo } +    it { subject.new(html).preferred.should           == html  } +    it { subject.new(json).preferred.should           == json  } +    it { subject.new(option).preferred.should         == foo   } +    it { subject.new(simple_accept).preferred.should  == html  } +    it { subject.new(quality_accept).preferred.should == html  } +    it { subject.new(random_accept).preferred.should  == html  } +    it { subject.new(lower_accept).preferred.should   == foo   } +    it { subject.new(nil).preferred.should            == '*/*' } +    it { subject.new('').preferred.should             == '*/*' } +    it { subject.new('text / html').preferred.should  == html  }    end  #  context 'with mapping' do | 
