Skip to content

Commit

Permalink
fixes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 10, 2015
1 parent 5b34557 commit e77a818
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions library/types/test/string_test.rb
Expand Up @@ -173,7 +173,7 @@
end

# FIXME: looks like bug
it "if padding is more then one character then it is counted in length as one" do
it "presumming padding is only one character long otherwise it creates longer string" do

This comment has been minimized.

Copy link
@ancorgs

ancorgs Feb 10, 2015

Contributor

This still does not fix the original problem of outputting unreadable English like "it presumming padding".

This comment has been minimized.

Copy link
@jreidinger

jreidinger Feb 10, 2015

Author Member

any suggestions? I have trouble to formulate it accurate and readable :)

This comment has been minimized.

Copy link
@ancorgs

ancorgs Feb 10, 2015

Contributor

Actually my first comment included this suggestion:
it "presumes padding is only one character long" do
But if you prefer something more explicit, it could be:
it "creates a longer string if padding is more than one character long" do

expect(subject.SuperPad("test", 6, "abc", :left)).to eq "testabcabc"
end
end
Expand Down Expand Up @@ -250,7 +250,7 @@
expect(subject.ParseOptions("a=\\n", "interpret_backslash" => false)).to eq ["a=\\n"]
end

it "removes backslash from invalid sequestion if backslash is interpretted" do
it "removes backslash from invalid sequention if backslash is interpretted" do

This comment has been minimized.

Copy link
@ancorgs

ancorgs Feb 10, 2015

Contributor

"sequention" still does not sound English to me. Don't you mean "sequence"?

This comment has been minimized.

Copy link
@jreidinger

jreidinger Feb 10, 2015

Author Member

It should be term for operation in sequential logic - http://link.springer.com/chapter/10.1007%2F978-3-642-21611-4_3

This comment has been minimized.

Copy link
@ancorgs

ancorgs Feb 10, 2015

Contributor

Wow! There are always new things to learn. 😉

This comment has been minimized.

Copy link
@jreidinger

jreidinger Feb 10, 2015

Author Member

I know it only because in czech is similar word and I learn about it on university :)

expect(subject.ParseOptions("a=\\q", "interpret_backslash" => true)).to eq ["a=q"]
end

Expand Down Expand Up @@ -381,20 +381,30 @@
describe ".YesNo" do
it "returns translated \"Yes\" if param is true" do
expect(subject.YesNo(true)).to eq "Yes"

allow(subject).to receive(:_).and_return "Ano"
expect(subject.YesNo(true)).to eq "Ano"
end

it "returns translated \"No\" if param is false" do
expect(subject.YesNo(false)).to eq "No"

allow(subject).to receive(:_).and_return "Ne"
expect(subject.YesNo(true)).to eq "Ne"
end

it "returns translated \"No\" if param is nil" do
expect(subject.YesNo(nil)).to eq "No"

allow(subject).to receive(:_).and_return "Ne"
expect(subject.YesNo(true)).to eq "Ne"
end
end

describe ".FormatRateMessage" do
it "returns text with %1 replaced by formated rate for average and current download " do
expect(subject.FormatRateMessage("Downloading %1", 1 << 20, 1 << 10)).to eq "Downloading 1 KiB/s (on average 1.00 MiB/s)"
expect(subject.FormatRateMessage("Downloading %1", 1025 << 20, 1025 << 30)).to eq "Downloading 1.001 TiB/s (on average 1.001 GiB/s)"
end

it "returns text with %1 replaced by format current rate string if avg_rate is zero" do
Expand Down Expand Up @@ -593,7 +603,7 @@
expect(subject.FormatFilename("/really/long/file/name", 10)).to eq "/.../name"
end

it "returns whole file_path if it fit len" do
it "returns whole file_path if it fits len" do
expect(subject.FormatFilename("/really/long/file/name", 50)).to eq "/really/long/file/name"
end

Expand Down Expand Up @@ -621,6 +631,7 @@
expect(subject.FindMountPoint("/boot/grub2", mount_points)).to eq "/boot"
expect(subject.FindMountPoint("/var", mount_points)).to eq "/var"
expect(subject.FindMountPoint("/usr", mount_points)).to eq "/"
expect(subject.FindMountPoint("/usr", ["/var"])).to eq "/"
end

it "returns \"/\" if dir is nil or empty" do
Expand Down

0 comments on commit e77a818

Please sign in to comment.