assertion 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe Assertion::NameError do
4
-
5
- subject(:error) { described_class.new :foo, :bar }
6
-
7
- describe ".new" do
8
-
9
- it { is_expected.to be_kind_of ::NameError }
10
-
11
- it { is_expected.to be_frozen }
12
-
13
- end # describe .new
14
-
15
- describe "#message" do
16
-
17
- subject(:message) { error.message }
18
-
19
- it "returns a proper message" do
20
- expect(subject)
21
- .to include "Wrong name(s) for attribute(s): foo, bar"
22
- end
23
-
24
- end # describe #message
25
-
26
- end # describe Assertion::NameError
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe Assertion::NotImplementedError do
4
-
5
- subject(:error) { described_class.new klass, :foo }
6
- let(:klass) { double name: :Test }
7
-
8
- describe ".new" do
9
-
10
- it { is_expected.to be_kind_of ::NotImplementedError }
11
-
12
- it { is_expected.to be_frozen }
13
-
14
- end # describe .new
15
-
16
- describe "#message" do
17
-
18
- subject(:message) { error.message }
19
-
20
- it "returns a proper message" do
21
- expect(subject).to include "Test#foo method not implemented"
22
- end
23
-
24
- end # describe #message
25
-
26
- end # describe Assertion::NotImplementedError
@@ -1,19 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe Assertion::I18n, "#scope" do
4
-
5
- subject { fn[input] }
6
-
7
- let(:fn) { described_class[:scope] }
8
- let(:input) { "Foo::BarBaz" }
9
- let(:output) { [:assertion, :"foo/bar_baz"] }
10
-
11
- it "doesn't mutate the input" do
12
- expect { subject }.not_to change { input }
13
- end
14
-
15
- it "returns the class scope" do
16
- expect(subject).to eql output
17
- end
18
-
19
- end # describe Assertion::I18n#scope
@@ -1,28 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe Assertion::I18n, "#translate" do
4
-
5
- subject { fn[input] }
6
-
7
- let(:fn) { described_class[:translate, scope, args] }
8
- let(:args) { { foo: :FOO } }
9
- let(:scope) { double }
10
- let(:input) { double }
11
- let(:output) { double }
12
-
13
- before do
14
- allow(::I18n)
15
- .to receive(:t)
16
- .with(input, foo: :FOO, scope: scope)
17
- .and_return output
18
- end
19
-
20
- it "doesn't mutate the input" do
21
- expect { subject }.not_to change { input }
22
- end
23
-
24
- it "returns the string converted to snake case" do
25
- expect(subject).to eql output
26
- end
27
-
28
- end # describe Assertion::I18n#translate