nov-smartfm 0.4.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  module Smartfm::Version
2
- MAJOR = 0
3
- MINOR = 4
4
- REVISION = 1
2
+ MAJOR = 1
3
+ MINOR = 0
4
+ REVISION = 0
5
5
  class << self
6
6
  def to_version
7
7
  "#{MAJOR}.#{MINOR}.#{REVISION}"
@@ -2,15 +2,25 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
2
 
3
3
  smart = Smartfm::Item.find(33158, :include_sentences => true)
4
4
 
5
- describe Smartfm::Item do
6
- it "should respond to attribute methods" do
7
- Smartfm::Item::ATTRIBUTES.each do |attr|
5
+ Smartfm::Item::ATTRIBUTES.each do |attr|
6
+ describe Smartfm::Item, "##{attr}" do
7
+ it "should be accessible" do
8
8
  smart.should respond_to(attr)
9
9
  end
10
- Smartfm::Item::Response::ATTRIBUTES.each do |attr|
10
+ end
11
+ end
12
+
13
+ Smartfm::Item::Response::ATTRIBUTES.each do |attr|
14
+ describe Smartfm::Item::Response, "##{attr}" do
15
+ it "should be accessible" do
11
16
  smart.responses.first.should respond_to(attr)
12
17
  end
13
- Smartfm::Item::Cue::ATTRIBUTES.each do |attr|
18
+ end
19
+ end
20
+
21
+ Smartfm::Item::Cue::ATTRIBUTES.each do |attr|
22
+ describe Smartfm::Item::Cue, "##{attr}" do
23
+ it "should be accessibles" do
14
24
  smart.cue.should respond_to(attr)
15
25
  end
16
26
  end
@@ -2,10 +2,18 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
2
 
3
3
  matake_likes = Smartfm::User.find('matake').likes
4
4
 
5
- describe Smartfm::Like do
6
- it "should respond to attribute methods" do
7
- Smartfm::Like::ATTRIBUTES.each do |attr|
5
+ Smartfm::Like::ATTRIBUTES.each do |attr|
6
+ describe Smartfm::Like, "##{attr}" do
7
+ it "should be accessible" do
8
8
  matake_likes.first.should respond_to(attr)
9
9
  end
10
10
  end
11
+ end
12
+
13
+ Smartfm::Like::ATTRIBUTES.each do |attr|
14
+ describe Smartfm::Like, "##{attr}" do
15
+ it "should not be nil" do
16
+ matake_likes.first.should_not be_nil
17
+ end
18
+ end
11
19
  end
@@ -2,19 +2,46 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
2
 
3
3
  core_2000 = Smartfm::List.find(705)
4
4
 
5
- describe Smartfm::List do
6
- it "should respond to attribute methods" do
7
- Smartfm::List::ATTRIBUTES.each do |attr|
5
+ Smartfm::List::ATTRIBUTES.each do |attr|
6
+ describe Smartfm::List, "##{attr}" do
7
+ it "should be accessible" do
8
8
  core_2000.should respond_to(attr)
9
9
  end
10
- Smartfm::List::Application::ATTRIBUTES.each do |attr|
11
- core_2000.iknow.should respond_to(attr)
12
- core_2000.dictation.should respond_to(attr)
13
- core_2000.brainspeed.should respond_to(attr)
10
+ end
11
+ end
12
+
13
+ Smartfm::List::READONLY_ATTRIBUTES.each do |attr|
14
+ describe Smartfm::List, "##{attr}" do
15
+ it "should not be nil" do
16
+ core_2000.should_not be_nil
14
17
  end
15
18
  end
16
19
  end
17
20
 
21
+ [:iknow, :dictation, :brainspeed].each do |application|
22
+ Smartfm::List::Application::ATTRIBUTES.each do |attr|
23
+ describe Smartfm::List::Application, "##{attr}" do
24
+ it "should be accessible for #{application}" do
25
+ core_2000.send(application).should respond_to(attr)
26
+ end
27
+ it "should not be nil for #{application}" do
28
+ core_2000.send(application).send(attr).should_not be_nil unless attr == :progress
29
+ end
30
+ end
31
+ end
32
+ describe Smartfm::List::Application, "#available?" do
33
+ it "should be true for #{application}" do
34
+ core_2000.send(application).available?.should be_true
35
+ end
36
+ end
37
+ end
38
+
39
+ describe Smartfm::List::Application, "#progress" do
40
+ it "should be nil for brainspeed" do
41
+ core_2000.brainspeed.progress.should be_nil
42
+ end
43
+ end
44
+
18
45
  describe Smartfm::List, '#items' do
19
46
  it "should return a Array of Smartfm::Item" do
20
47
  core_2000.items.should be_a(Array)
@@ -40,4 +67,4 @@ describe Smartfm::List, '#likes' do
40
67
  like.should be_a(Smartfm::Like)
41
68
  end
42
69
  end
43
- end
70
+ end
@@ -1,7 +1,11 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
2
 
3
- describe String do
4
- it "should respond to length" do
5
- "hoge".should respond_to(:length)
3
+ matake_notifications = Smartfm::User.find('matake').notifications
4
+
5
+ Smartfm::Notification::ATTRIBUTES.each do |attr|
6
+ describe Smartfm::Notification, "##{attr}" do
7
+ it "should be accessible" do
8
+ matake_notifications.first.should respond_to(attr)
9
+ end
6
10
  end
7
11
  end
@@ -1,7 +1,11 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
2
 
3
- describe String do
4
- it "should respond to length" do
5
- "hoge".should respond_to(:length)
3
+ smartest = Smartfm::Sentence.find(10828)
4
+
5
+ Smartfm::Sentence::ATTRIBUTES.each do |attr|
6
+ describe Smartfm::Sentence, "##{attr}" do
7
+ it "should be accessible" do
8
+ smartest.should respond_to(attr)
9
+ end
6
10
  end
7
11
  end
@@ -1,25 +1,44 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
2
 
3
3
  matake = Smartfm::User.find('matake')
4
+ matake_study = matake.study
4
5
 
5
- describe Smartfm::User do
6
- it "should respond to attribute methods" do
7
- Smartfm::User::ATTRIBUTES.each do |attr|
6
+ Smartfm::User::ATTRIBUTES.each do |attr|
7
+ describe Smartfm::User, "##{attr}" do
8
+ it "should be accessible" do
8
9
  matake.should respond_to(attr)
9
10
  end
10
- Smartfm::User::Profile::ATTRIBUTES.each do |attr|
11
+ end
12
+ end
13
+
14
+ Smartfm::User::Profile::ATTRIBUTES.each do |attr|
15
+ describe Smartfm::User::Profile, "##{attr}" do
16
+ it "should be accessible" do
11
17
  matake.profile.should respond_to(attr)
12
18
  end
13
- Smartfm::User::Study::ATTRIBUTES.each do |attr|
14
- matake.study.should respond_to(attr)
19
+ end
20
+ end
21
+
22
+ Smartfm::User::Study::ATTRIBUTES.each do |attr|
23
+ describe Smartfm::User::Study, "##{attr}" do
24
+ it "should be accessible" do
25
+ matake_study.should respond_to(attr)
15
26
  end
16
- Smartfm::User::Study::Result::ATTRIBUTES.each do |attr|
17
- matake.study.results.each do |result|
18
- result.should respond_to(attr)
19
- end
27
+ end
28
+ end
29
+
30
+ Smartfm::User::Study::Result::ATTRIBUTES.each do |attr|
31
+ describe Smartfm::User::Study::Result, "##{attr}" do
32
+ it "should be accessible" do
33
+ matake_study.results.first.should respond_to(attr)
20
34
  end
21
- Smartfm::User::Study::TotalSummary::ATTRIBUTES.each do |attr|
22
- matake.study.total_summary.should respond_to(attr)
35
+ end
36
+ end
37
+
38
+ Smartfm::User::Study::TotalSummary::ATTRIBUTES.each do |attr|
39
+ describe Smartfm::User::Study::TotalSummary, "##{attr}" do
40
+ it "shoud be accessible" do
41
+ matake_study.total_summary.should respond_to(attr)
23
42
  end
24
43
  end
25
44
  end
@@ -84,18 +103,15 @@ end
84
103
 
85
104
  describe Smartfm::User, '#study' do
86
105
  it "should return a instance of Smartfm::User::Study" do
87
- matake.study.should be_a(Smartfm::User::Study)
88
- matake.study(:application => 'iknow').should be_a(Smartfm::User::Study)
89
- matake.study(:application => 'dictation').should be_a(Smartfm::User::Study)
90
- matake.study(:application => 'brainspeed').should be_a(Smartfm::User::Study)
106
+ matake_study.should be_a(Smartfm::User::Study)
91
107
  matake.study(:application => 'fuckin_windows').should be_nil
92
108
  end
93
109
  end
94
110
 
95
111
  describe Smartfm::User::Study, '#results' do
96
112
  it "should return a Array of Smartfm::User::Study::Result" do
97
- matake.study.results.should be_a(Array)
98
- matake.study.results.each do |result|
113
+ matake_study.results.should be_a(Array)
114
+ matake_study.results.each do |result|
99
115
  result.should be_a(Smartfm::User::Study::Result)
100
116
  end
101
117
  end
@@ -103,6 +119,6 @@ end
103
119
 
104
120
  describe Smartfm::User::Study, '#total_summary' do
105
121
  it "should return a Array of Smartfm::User::Study::TotalSummary" do
106
- matake.study.total_summary.should be_a(Smartfm::User::Study::TotalSummary)
122
+ matake_study.total_summary.should be_a(Smartfm::User::Study::TotalSummary)
107
123
  end
108
124
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nov-smartfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-30 00:00:00 -07:00
12
+ date: 2009-05-01 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency