Permalink
Browse files

Whitespace tweaks

  • Loading branch information...
1 parent 7aa2a96 commit 2cf14acca96865faff2ba6ec141f829d2798843d @mocoso mocoso committed Nov 8, 2011
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/split/alternative.rb
  2. +1 −1 lib/split/helper.rb
  3. +1 −1 spec/alternative_spec.rb
  4. +2 −2 spec/helper_spec.rb
View
@@ -95,7 +95,7 @@ def delete
end
def self.valid?(name)
- String === name || hash_with_correct_values?(name)
+ String === name || hash_with_correct_values?(name)
end
def self.hash_with_correct_values?(name)
View
@@ -27,7 +27,7 @@ def ab_test(experiment_name, *alternatives)
concat(capture(ret, &block))
false
else
- yield(ret)
+ yield(ret)
end
else
ret
View
@@ -9,7 +9,7 @@
alternative = Split::Alternative.new('Basket', 'basket_text')
alternative.name.should eql('Basket')
end
-
+
it "return only the name" do
experiment = Split::Experiment.new('basket_text', {'Basket' => 0.6}, {"Cart" => 0.4})
alternative = Split::Alternative.new('Basket', 'basket_text')
View
@@ -57,12 +57,12 @@
ret = ab_test('link_color', 'blue', 'red') { |alternative| "shared/#{alternative}" }
ret.should eql("shared/#{alt}")
end
-
+
it "should allow the share of visitors see an alternative to be specificed" do
ab_test('link_color', {'blue' => 0.8}, {'red' => 20})
['red', 'blue'].should include(ab_user['link_color'])
end
-
+
it "should allow alternative weighting interface as a single hash" do
ab_test('link_color', 'blue' => 0.01, 'red' => 0.2)
experiment = Split::Experiment.find('link_color')

0 comments on commit 2cf14ac

Please sign in to comment.