This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace bespoke spec framework with minitest/spec.
- Loading branch information
1 parent
0f2f78f
commit 5d360ba
Showing
7 changed files
with
131 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
require "test_helper" | ||
|
||
context ".playground_should_autoconnect?" do | ||
describe Vanity::Autoconnect do | ||
describe ".playground_should_autoconnect?" do | ||
|
||
test "returns true by default" do | ||
autoconnect = Vanity::Autoconnect.playground_should_autoconnect? | ||
assert autoconnect == true | ||
end | ||
it "returns true by default" do | ||
autoconnect = Vanity::Autoconnect.playground_should_autoconnect? | ||
assert autoconnect == true | ||
end | ||
|
||
test "returns false if environment flag is set" do | ||
ENV['VANITY_DISABLED'] = '1' | ||
autoconnect = Vanity::Autoconnect.playground_should_autoconnect? | ||
assert autoconnect == false | ||
ENV['VANITY_DISABLED'] = nil | ||
end | ||
it "returns false if environment flag is set" do | ||
ENV['VANITY_DISABLED'] = '1' | ||
autoconnect = Vanity::Autoconnect.playground_should_autoconnect? | ||
assert autoconnect == false | ||
ENV['VANITY_DISABLED'] = nil | ||
end | ||
|
||
test "returns false if in assets:precompile rake task" do | ||
Rake.expects(:application).returns(stub(:top_level_tasks => ['assets:precompile'])) | ||
autoconnect = Vanity::Autoconnect.playground_should_autoconnect? | ||
assert autoconnect == false | ||
it "returns false if in assets:precompile rake task" do | ||
Rake.expects(:application).returns(stub(:top_level_tasks => ['assets:precompile'])) | ||
autoconnect = Vanity::Autoconnect.playground_should_autoconnect? | ||
assert autoconnect == false | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
require "test_helper" | ||
|
||
context "Object#track!" do | ||
test "identity option sets identity" do | ||
metric "Coolness" | ||
new_ab_test :foobar do | ||
alternatives "foo", "bar" | ||
metrics :coolness | ||
end | ||
track! :coolness, :identity=>'quux', :values=>[2] | ||
describe Object do | ||
describe "#track!" do | ||
it "identity option sets identity" do | ||
metric "Coolness" | ||
new_ab_test :foobar do | ||
alternatives "foo", "bar" | ||
metrics :coolness | ||
end | ||
track! :coolness, :identity=>'quux', :values=>[2] | ||
|
||
assert_equal 2, experiment(:foobar).alternatives.sum(&:conversions) | ||
# experiment(:foobar).alternatives.sum(&:conversions).must_equal 2 | ||
assert_equal 2, experiment(:foobar).alternatives.sum(&:conversions) | ||
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
Oops, something went wrong.