Skip to content

Commit

Permalink
updated to new rspec expect syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Møller Riis committed Feb 15, 2016
1 parent 95dde64 commit e6c1cf2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/idn_spec.rb
Expand Up @@ -6,25 +6,25 @@
describe "to_unicode" do
it "should pass all test cases" do
TESTCASES_JOSEFSSON.sort.each do |testcase, vector|
SimpleIDN.to_unicode(vector[1]).should == vector[0]
expect(SimpleIDN.to_unicode(vector[1])).to eq(vector[0])
end
end

it "should respect * and not try to decode it" do
SimpleIDN.to_unicode("*.xn--mllerriis-l8a.com").should == "*.møllerriis.com"
expect(SimpleIDN.to_unicode("*.xn--mllerriis-l8a.com")).to eq("*.møllerriis.com")
end

it "should respect leading _ and not try to encode it" do
SimpleIDN.to_unicode("_something.xn--mllerriis-l8a.com").should == "_something.møllerriis.com"
expect(SimpleIDN.to_unicode("_something.xn--mllerriis-l8a.com")).to eq("_something.møllerriis.com")
end

it "should return nil for nil" do
SimpleIDN.to_unicode(nil).should be_nil
expect(SimpleIDN.to_unicode(nil)).to be_nil
end

it "should return . if only . given" do
# https://github.com/mmriis/simpleidn/issues/3
SimpleIDN.to_unicode('.').should == '.'
expect(SimpleIDN.to_unicode('.')).to eq('.')
end

it "raises when the input is an invalid ACE" do
Expand All @@ -35,25 +35,25 @@
describe "to_ascii" do
it "should pass all test cases" do
TESTCASES_JOSEFSSON.sort.each do |testcase, vector|
SimpleIDN.to_ascii(vector[0]).should == vector[1].downcase
expect(SimpleIDN.to_ascii(vector[0])).to eq(vector[1].downcase)
end
end

it "should respect * and not try to encode it" do
SimpleIDN.to_ascii("*.hello.com").should == "*.hello.com"
expect(SimpleIDN.to_ascii("*.hello.com")).to eq("*.hello.com")
end

it "should respect leading _ and not try to encode it" do
SimpleIDN.to_ascii("_something.example.org").should == "_something.example.org"
expect(SimpleIDN.to_ascii("_something.example.org")).to eq("_something.example.org")
end

it "should return nil for nil" do
SimpleIDN.to_ascii(nil).should be_nil
expect(SimpleIDN.to_ascii(nil)).to be_nil
end

it "should return . if only . given" do
# https://github.com/mmriis/simpleidn/issues/3
SimpleIDN.to_ascii('.').should == '.'
expect(SimpleIDN.to_ascii('.')).to eq('.')
end
end
end

0 comments on commit e6c1cf2

Please sign in to comment.