[DRE-commits] [ruby-factory-girl] 02/05: Port specs to RSpec3 (Closes: #795033)

Cédric Boutillier boutil at moszumanska.debian.org
Fri Sep 11 13:46:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-factory-girl.

commit 307941e99d920181caacfeed6a03c57e0b12df43
Author: Cédric Boutillier <boutil at debian.org>
Date:   Fri Sep 11 15:22:56 2015 +0200

    Port specs to RSpec3 (Closes: #795033)
---
 debian/patches/rspec3.patch | 130 ++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series       |   1 +
 2 files changed, 131 insertions(+)

diff --git a/debian/patches/rspec3.patch b/debian/patches/rspec3.patch
new file mode 100644
index 0000000..4ab4a56
--- /dev/null
+++ b/debian/patches/rspec3.patch
@@ -0,0 +1,130 @@
+Description: port test suite to RSpec3
+Author: Cédric Boutillier <boutil at debian.org>
+Bug-Debian: https://bugs.debian.org/795033
+Forwarded: https://github.com/thoughtbot/factory_girl/pull/814
+Last-Update: 2015-09-11
+
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -4,6 +4,7 @@
+ #require 'rubygems'
+ require 'rspec'
+ require 'rspec/autorun'
++require 'rspec/its'
+ 
+ #require "simplecov"
+ 
+--- a/spec/factory_girl/find_definitions_spec.rb
++++ b/spec/factory_girl/find_definitions_spec.rb
+@@ -1,6 +1,6 @@
+ require 'spec_helper'
+ 
+-share_examples_for "finds definitions" do
++shared_examples_for "finds definitions" do
+   before do
+     FactoryGirl.stubs(:load)
+     FactoryGirl.find_definitions
+--- a/spec/acceptance/traits_spec.rb
++++ b/spec/acceptance/traits_spec.rb
+@@ -241,7 +241,7 @@
+   context "adding traits in create" do
+     subject { FactoryGirl.create(:user, :admin, :great, name: "Joe") }
+ 
+-    its(:admin) { should be_true }
++    its(:admin) { should be true }
+     its(:name)  { should eq "JOE" }
+ 
+     it "doesn't modify the user factory" do
+@@ -254,21 +254,21 @@
+   context "adding traits in build" do
+     subject { FactoryGirl.build(:user, :admin, :great, name: "Joe") }
+ 
+-    its(:admin) { should be_true }
++    its(:admin) { should be true }
+     its(:name)  { should eq "Joe" }
+   end
+ 
+   context "adding traits in attributes_for" do
+     subject { FactoryGirl.attributes_for(:user, :admin, :great) }
+ 
+-    its([:admin]) { should be_true }
++    its([:admin]) { should be true }
+     its([:name])  { should eq "John" }
+   end
+ 
+   context "adding traits in build_stubbed" do
+     subject { FactoryGirl.build_stubbed(:user, :admin, :great, name: "Jack") }
+ 
+-    its(:admin) { should be_true }
++    its(:admin) { should be true }
+     its(:name)  { should eq "Jack" }
+   end
+ 
+@@ -279,7 +279,7 @@
+ 
+     it "creates all the records" do
+       subject.each do |record|
+-        expect(record.admin).to be_true
++        expect(record.admin).to be true
+         expect(record.name).to eq "JOE"
+       end
+     end
+@@ -292,7 +292,7 @@
+ 
+     it "builds all the records" do
+       subject.each do |record|
+-        expect(record.admin).to be_true
++        expect(record.admin).to be true
+         expect(record.name).to eq "Joe"
+       end
+     end
+--- a/spec/factory_girl/strategy/create_spec.rb
++++ b/spec/factory_girl/strategy/create_spec.rb
+@@ -20,6 +20,6 @@
+     evaluation = evaluation_class.new
+     evaluation.stubs(object: nil, notify: nil)
+     subject.result(evaluation)
+-    expect(evaluation.block_run).to be_true
++    expect(evaluation.block_run).to be true
+   end
+ end
+--- a/spec/acceptance/sequence_context_spec.rb
++++ b/spec/acceptance/sequence_context_spec.rb
+@@ -38,7 +38,7 @@
+       end
+     end
+ 
+-    expect(FactoryGirl.build(:sequence_with_frozen).id).to be_false
++    expect(FactoryGirl.build(:sequence_with_frozen).id).to be false
+   end
+ 
+   it 'allows direct reference of a method in a sequence' do
+--- a/spec/acceptance/modify_factories_spec.rb
++++ b/spec/acceptance/modify_factories_spec.rb
+@@ -134,7 +134,7 @@
+ 
+         its(:name)  { should eq "Great User" }
+         its(:email) { should eq "Great User-modified at example.com" }
+-        its(:admin) { should be_true }
++        its(:admin) { should be true }
+       end
+ 
+       context "overriding dynamic attributes" do
+@@ -142,7 +142,7 @@
+ 
+         its(:name)  { should eq "Great User" }
+         its(:email) { should eq "perfect at example.com" }
+-        its(:admin) { should be_true }
++        its(:admin) { should be true }
+       end
+ 
+       context "overriding static attributes" do
+@@ -150,7 +150,7 @@
+ 
+         its(:name)  { should eq "wonderful" }
+         its(:email) { should eq "wonderful-modified at example.com" }
+-        its(:admin) { should be_true }
++        its(:admin) { should be true }
+       end
+     end
+   end
diff --git a/debian/patches/series b/debian/patches/series
index efd5b33..ecc628c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 remove-simplecov-rubygems-require.patch
+rspec3.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-factory-girl.git



More information about the Pkg-ruby-extras-commits mailing list