-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Vagab/cooler-with
- Loading branch information
Showing
11 changed files
with
61 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.7 | ||
0.5.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
RSpec.describe "With" do | ||
subject { WithDummy.new(params) } | ||
|
||
context "two with blocks" do | ||
context "first validation is violated" do | ||
let!(:params) { { a: "a", c: :a } } | ||
|
||
its(:valid?) { should be_truthy } | ||
|
||
context "both validations are calls to validate" do | ||
let!(:params) { { a: :a, c: "c" } } | ||
|
||
its(:valid?) { should be_falsey } | ||
end | ||
end | ||
end | ||
end | ||
|
||
class WithDummy | ||
include Statinize | ||
|
||
statinize do | ||
with type: Symbol do | ||
attribute :a | ||
end | ||
|
||
with presence: true do | ||
attribute :a | ||
end | ||
|
||
attribute :c | ||
with type: Symbol do | ||
validate :c | ||
end | ||
|
||
with presence: true do | ||
validate :c | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters