summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-07-20 17:56:35 -0600
committermo khan <mo@mokhan.ca>2013-07-20 17:56:35 -0600
commit018513d8d9cc935df5632491ffbf6b6ffd5ef5e0 (patch)
treef01cc14db76dc0aa9d2c6eaa9faab0c6631d7f2a
parent381c938ffb77feee283b74c03a7c928478d1a5bf (diff)
split out selection specs to a separate file
-rw-r--r--Gemfile.lock2
-rw-r--r--spec/integration/crud/select_spec.rb30
-rw-r--r--spec/integration/example_spec.rb24
3 files changed, 31 insertions, 25 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index d18c100..886886c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- humble (0.0.1374364444)
+ humble (0.0.1374364579)
sequel
GEM
diff --git a/spec/integration/crud/select_spec.rb b/spec/integration/crud/select_spec.rb
new file mode 100644
index 0000000..c4778ba
--- /dev/null
+++ b/spec/integration/crud/select_spec.rb
@@ -0,0 +1,30 @@
+require "integration_helper"
+
+describe "select items" do
+ include_context "orm"
+
+ context "when fetching all items" do
+ before :each do
+ @id = connection[:movies].insert(:name => 'monsters inc')
+ end
+
+ let(:results) { session.find_all Movie }
+
+ it "should return the correct number of movies" do
+ results.count.should == 1
+ end
+
+ it "should return each movie with its name" do
+ results.first.name.should == 'monsters inc'
+ end
+
+ it "should return instances of the target type" do
+ results.first.should be_instance_of(Movie)
+ end
+
+ it "should include the saved movie" do
+ results.should include(Movie.new(:id => @id, :name => 'monsters inc'))
+ end
+ end
+
+end
diff --git a/spec/integration/example_spec.rb b/spec/integration/example_spec.rb
index 34d56c4..97b1adb 100644
--- a/spec/integration/example_spec.rb
+++ b/spec/integration/example_spec.rb
@@ -3,30 +3,6 @@ require "integration_helper"
describe "crud" do
include_context "orm"
- context "when fetching all items" do
- before :each do
- @id = connection[:movies].insert(:name => 'monsters inc')
- end
-
- let(:results) { session.find_all Movie }
-
- it "should return the correct number of movies" do
- results.count.should == 1
- end
-
- it "should return each movie with its name" do
- results.first.name.should == 'monsters inc'
- end
-
- it "should return instances of the target type" do
- results.first.should be_instance_of(Movie)
- end
-
- it "should include the saved movie" do
- results.should include(Movie.new(:id => @id, :name => 'monsters inc'))
- end
- end
-
context "when inserting a new record" do
let(:movie) { Movie.new(:name => 'oop') }